Version:

xdmp functions (Security)

The security built-in functions are XQuery functions to perform many security-related tasks in MarkLogic Server.

22 functions
Function nameDescription
xdmp:ampReturns the amp ID for the specified amp.
xdmp:amp-rolesReturns the set of all roles assigned to an amp, including roles directly assigned to the amp and roles inherited by other roles.
xdmp:can-grant-rolesTests whether a user can grant or revoke a set of roles.
xdmp:default-collectionsReturns the collections any new document would get if the current user were to insert a document without specifying the collections.
xdmp:default-permissionsReturns the permissions any new document would get if the current user were to insert a document without specifying the default permissions.
xdmp:document-get-permissionsReturns the permissions to a given document.
xdmp:external-securityReturns the external security ID for the specified external security name.
xdmp:get-current-rolesReturns all the current roles, both assigned and inherited by the current user and any received from amps.
xdmp:get-current-userReturns the name of the current user.
xdmp:get-current-useridReturns the ID of the current user.
xdmp:get-request-userIf this App Server is using application-level authentication, returns the ID of the user in the last successful call to xdmp:login.
xdmp:has-privilegeTests whether the current user has at least one of a given set of privileges.
xdmp:permissionReturns a permission element in the security namespace corresponding to the named role and capability given.
xdmp:privilegeReturns the privilege ID for the specified privilege name.
xdmp:privilege-rolesReturns the set of all roles that have a given privilege.
xdmp:roleReturns the role ID for the specified role name.
xdmp:role-rolesReturns the set of all roles inherited by a given role, including roles directly assigned to the role and roles inherited from other roles.
xdmp:security-assertTests whether the current user has at least one of a given set of privileges.
xdmp:userReturns the user ID for the specified user name.
xdmp:user-external-securityReturns external security id and user name for an external user.
xdmp:user-rolesReturns all roles assigned to a user, including roles directly assigned to the user and roles inherited by other roles.
xdmp:userid-rolesReturns all roles assigned to a user, including roles directly assigned to the user and roles inherited by other roles.