Currently, I am in the midst of a project that involves utilizing a cross-storage JavaScript library known as JIO. This library facilitates the storage, sharing, and synchronization of JSON documents across various storage options such as S3 and Dav.
Setting security concerns aside, my main query pertains to whether there exists a method to inhibit the editing of a collaboratively shared document at a particular "stage". For instance, once a document is deemed "published", I aim for it to become immutable, even for users granted permission to edit.
In order to achieve this, I intend to establish a status flag and store this within the document's metadata. Subsequently, a response similar to the following would be relayed to the client:
{
"id": 123,
"created": "2013/12/01:11:10:59",
"state": "published"
...
}
While it is feasible to prevent alterations if state !== "published"
during the editing and saving process, the challenge lies in guarding against tampering with documents when unauthorized individuals could potentially execute any desired method via tools like Firebug.
Question:
I am curious if there exists a way to effectively "lock" a JSON document to deter any editing attempts in the absence of server-side involvement?