Various API calls return a symbolic expression list (rights N), with N as a number, that encodes the access rights the user currently has. N is an integer number between 0 and 62.1
The value “0” signals that something went wrong internally while determining the access rights.
A value of “1” says, that the current user has no access right for the given zettel. In most cases, this value will not occur, because only zettel are presented, which are at least readable by the current user.
Values “2” to “62” are binary encoded values, where each bit signals a special right.
Bit number | Bit value | Meaning |
---|---|---|
1 | 2 | User is allowed to create a new zettel |
2 | 4 | User is allowed to read the zettel |
3 | 8 | User is allowed to update the zettel |
4 | 16 | (not in use; was assigned to an operation) |
5 | 32 | User is allowed to delete the zettel |
The algorithm to calculate the actual access rights from the value is relatively simple:
As an example, let's assume a rights value of 42:
In practice, not every rights value will occur. A Zettelstore in read-only mode will always return the value 4. Similar, a Zettelstore that you started with a double-click will return either the value “6” (reading and updating) or the value “62” (all operations are allowed).
If you have added an additional user to your Zettelstore, this might change. The access rights are calculated depending on enabled authentication, on the user role of the current user, on visibility rules for a given zettel and on the read-only status for the zettel.