Module for interacting with the Security Manager
Adds a Group ACE to the ACL of a resource or collection.
$path | The path to the resource or collection whose ACL you wish to add the ACE to. |
$group-name | The name of the group to create an ACE for. |
$allowed | true() if the ACE is allowing the permission mode, or false() if we are denying the permission mode |
$mode | The mode to set on the ACE e.g. 'rwx' |
Adds a manager to a groups managers. Can only be called by a group manager or DBA.
$group | The name of the group to which you wish to add a manager(s). |
$manager+ | The user(s) to add to the group managers. |
Adds a user to a group. Can only be called by a group manager or DBA.
$group | The name of the group whoose membership you wish to modify. |
$member+ | The user(s) to add to the group membership. |
Adds a User ACE to the ACL of a resource or collection.
$path | The path to the resource or collection whose ACL you wish to add the ACE to. |
$user-name | The name of the user to create an ACE for. |
$allowed | true() if the ACE is allowing the permission mode, or false() if we are denying the permission mode |
$mode | The mode to set on the ACE e.g. 'rwx' |
Changes the group owner of a resource or collection.
$path | The path to the resource or collection whose group owner you wish to set |
$group-name | The name of the user group owner to set on the resource or collection e.g. 'guest' |
Changes the mode of a resource or collection.
$path | The path to the resource or collection whose mode you wish to set |
$mode | The mode to set on the resource or collection e.g. 'rwxrwxrwx' |
Changes the owner of a resource or collection.
$path | The path to the resource or collection whose owner you wish to set |
$owner | The name of the user owner to set on the resource or collection e.g. 'guest'. You may also provide a group owner, by using the syntax 'user:group' if you wish. |
Removes all ACEs from the ACL of a resource or collection.
$path | The path to the resource or collection whose ACL you wish to clear. |
Creates a User Account.
$username | The User's username. |
$password | The User's password. |
$primary-group | The primary group of the user. |
$groups* | Any supplementary groups of which the user should be a member. |
Creates a User Account.
$username | The User's username. |
$password | The User's password. |
$primary-group | The primary group of the user. |
$groups* | Any supplementary groups of which the user should be a member. |
$full-name | The full name of the user. |
$description | A description of the user. |
Creates a User Account and a personal group for that user. The personal group takes the same name as the user, and is set as the user's primary group.
$username | The User's username. |
$password | The User's password. |
$groups* | Any supplementary groups of which the user should be a member. |
Creates a User Account and a personal group for that user. The personal group takes the same name as the user, and is set as the user's primary group.
$username | The User's username. |
$password | The User's password. |
$groups* | Any supplementary groups of which the user should be a member. |
$full-name | The full name of the user. |
$description | A description of the user. |
Creates a User Group. The current user will be set as the group's manager.
$group-name | The name of the group to create. |
Creates a User Group. The current user will be set as the group's manager.
$group-name | The name of the group to create. |
$description | A description of the group. |
Creates a User Group. The current user will be set as a manager of the group in addition to the specified managers.
$group-name | The name of the group to create. |
$managers+ | The usernames of users that will be a manager of this group. |
$description | A description of the group. |
Finds groups whoose group name starts with a matching string
$starts-with | The starting string against which to match group names |
Finds groups whoose group name contains the string fragment
$fragment | The fragment against which to match group names |
Finds users whoose personal name starts with a matching string
$starts-with | The starting string against which to match a personal name |
Finds users whoose first name or last name starts with a matching string
$starts-with | The starting string against which to match a first or last name |
Finds users whoose username starts with a matching string
$starts-with | The starting string against which to match usernames |
Gets a metadata attribute value for an account
$username | The username of the account to retrieve metadata from. |
$attribute | The fully qualified metadata attribute key name |
Gets a sequence of the metadata attribute keys that may be used for an account.
Gets a sequence of the metadata attribute keys present for an account
$username | The username of the account to retrieve metadata from. |
Gets a list of the group managers. Can only be called by a group manager.
$group | The group name to retrieve the list of managers for. |
Gets a list of the group members.
$group | The group name to retrieve the list of members for. |
Gets a metadata attribute value for a group
$group-name | The name of the group to retrieve metadata from. |
$attribute | The fully qualified metadata attribute key name |
Gets a sequence of the metadata attribute keys that may be used for a group.
Gets a sequence of the metadata attribute keys present for a group
$group-name | The name of the group to retrieve metadata from. |
Gets the permissions of a resource or collection.
$path | The path to the resource or collection to get permissions of. |
Gets the umask of a Users Account.
$username | The username of the account to retrieve the umask for. |
Returns the sequence of groups that the user $user is a member of. You must be a DBA or logged in as the user for which you are trying to retrieve group details for.
$user | The username to retrieve the group membership list for. |
Returns the primary group of the user $user. You must be a DBA or logged in as the user for which you are trying to retrieve group details for.
$user | The username to retrieve the primary group of. |
Determines whether a user group exists.
$group | The name of the user group to check for existence. |
Checks whether the current user has access to the resource or collection.
$path | The path to the resource or collection whose access of which you wish to check |
$mode | The partial mode to check against the resource or collection e.g. 'rwx' |
Returns the user and group names of the account executing the XQuery. If the real and effective accounts are different, then both the real and effective account details are returned, otherwise only the real account details are returned.
Inserts a Group ACE into the ACL of a resource or collection.
$path | The path to the resource or collection whose ACL you wish to add the ACE to. |
$index | The index in the ACL to insert the ACE before, subsequent entries will be renumbered |
$group-name | The name of the group to create an ACE for. |
$allowed | true() if the ACE is allowing the permission mode, or false() if we are denying the permission mode |
$mode | The mode to set on the ACE e.g. 'rwx' |
Inserts a User ACE into the ACL of a resource or collection.
$path | The path to the resource or collection whose ACL you wish to add the ACE to. |
$index | The index in the ACL to insert the ACE before, subsequent entries will be renumbered |
$user-name | The name of the user to create an ACE for. |
$allowed | true() if the ACE is allowing the permission mode, or false() if we are denying the permission mode |
$mode | The mode to set on the ACE e.g. 'rwx' |
Determines whether a user account is enabled. You must be a DBA, or you must be enquiring about your own user account.
$username | The username of the account to check the status for. |
Returns the true() if current account is authenticated, false() otherwise.
Determines if the user is a DBA.
$username | The username of the user account to check if they are a member of the DBA group. |
Returns the true() if current account is authenticated by an external realm, false() otherwise.
List all groups
List all users. You must be a DBA to enumerate all users, if you are not a DBA you will just get the username of the currently logged in user.
Converts a mode string e.g. 'rwxrwxrwx' to an octal number e.g. 0777.
$mode | The mode to convert to an octal string. |
Modified an ACE of an ACL of a resource or collection.
$path | The path to the resource or collection whose ACL you wish to modify the ACE of. |
$index | The index of the ACE in the ACL to modify |
$allowed | true() if the ACE is allowing the permission mode, or false() if we are denying the permission mode |
$mode | The mode to set on the ACE e.g. 'rwx' |
Converts an octal string e.g. '0777' to a mode string e.g. 'rwxrwxrwx'.
$octal | The octal string to convert to a mode. |
Changes the password of a User Account.
$username | The User's username. |
$password | The User's new password. |
Changes the password of a User Account by directly setting the stored digest password. The use-case for this function is migrating a user from one eXist instance to another.
$username | The User's username. |
$password-digest | The encoded digest of the User's new password (assumes eXist's default digest algorithm). |
Removes a User Account. If the user has a personal group you are responsible for removing that separately through sm:remove-group.
$username | The User's username. |
Removes an ACE from the ACL of a resource or collection.
$path | The path to the resource or collection whose ACL you wish to remove the ACE from. |
$index | The index of the ACE in the ACL to remove, subsequent entries will be renumbered |
Remove a User Group.
$group-name | The group-id to delete |
Removes a manager from a groups managers. Can only be called by a group manager of DBA.
$group | The name of the group from which you wish to remove a manager(s) |
$manager+ | The user(s) to remove from the group managers. |
Removes a user from a group. Can only be called by a group manager of DBA.
$group | The name of the group whoose membership you wish to modify. |
$member+ | The user(s) to remove from the group membership. |
Enabled or disables a users account. You must be a DBA to enable or disable an account.
$username | The username of the account to enable or disable. |
$enabled | true to enable the account, false to disable the account. |
Sets a metadata attribute value for an account
$username | The username of the account to set metadata for. |
$attribute | The metadata attribute key. |
$value | The metadata value, |
Sets a metadata attribute value for a group
$group-name | The name of the group to set metadata for. |
$attribute | The metadata attribute key. |
$value | The metadata value, |
Sets the umask of a Users Account.
$username | The username of the account to set the umask for. |
$umask | The umask to set as an integer. |
Sets the primary group of a user account. If the user is not yet in the group, then they are added to the group first.
$username | The name of the user account to set the primary group for. |
$group | The group to set as the primary group for the user. |
Determines whether a user exists.
$user | The username to check for existence. |