![]() |
Users, groups, and permissions | ![]() |
The additional layer
database/db-users.scm
allows you to specify read, write and administration permissions for database entries. There are two main types of users of TeXmacs databases: individual users (entries of type "user") and groups (entries of type "group"). Groups may delegate permissions to individual users or other groups. In addition, the special user #t stands for the super user, which has all permissions, and the special value "all" in a permission field grants the corresponding permission to everybody.
Users are identified by the identifiers of their entries in the user database $TEXMACS_HOME_PATH/users/users-master.tmdb; routines such as (get-default-user), (pseudo->user pseudo) and (user->pseudo uid) allow for the conversion between identifiers and pseudos.
Evaluate the body using the permissions of the specified user, which is either a user identifier, a list of user identifiers, or #t (the default, meaning no restrictions).
Specifies a pseudo for the user. Notice that name should specify the full name.
Ownership and read/write permissions for an entry. Notice that the wrappers below only check the owner and readable permissions: modifications require ownership. Under the encoding scheme :pseudos, the values of these fields are represented by user pseudos instead of user identifiers.
Delegate group permissions: a user (or group) listed in the delegate-readable field of a group inherits the readable permissions of that group, and similarly for the other attributes.
The actions only succeed when the current user owns the entry.
Unless the current user is #t, the current user is added to the owners of the new entry. If the resulting list of owners is empty, then no entry is created and #f is returned.
Only values are returned for which the current user has appropriate permissions (ownership or read permission). In the case of db-search, only entries owned by or readable for the current user are returned.
Check whether a user with identifier uid has a given permission permission-attr (such as "owner" or "readable") for the entry with identifier id. Group delegations are taken into account, and owners automatically have all other permissions.
Return the sorted list of the user uid (a user identifier or a list of identifiers) and all groups from which uid inherits the permission attr through delegation, followed by "all".