Changes

Jump to navigation Jump to search
12 bytes added ,  16:18, 9 March 2023
no edit summary
This [[Module Library|XQuery Module]] contains functions for creating and administering database users. The [[User Management]] article gives provides more information on database users and permissions.
=Conventions=
|- valign="top"
| '''Summary'''
|Returns the name of the currently logged -in user.
|- valign="top"
| '''Examples'''
|- valign="top"
| '''Summary'''
|Returns the names of all registered users that who are visible to the current user.
|- valign="top"
| '''Examples'''
|- valign="top"
| '''Summary'''
|Returns an element sequence, containing all registered users that who are visible to the current user.<br/>In addition to the {{Command|SHOW USERS}} command, encoded password strings and database permissions will be output. A user {{Code|$name}} can be specified to filter the results in advance.
|- valign="top"
| '''Examples'''
| width='120' | '''Signature'''
|<pre>user:check(
$name as xs:string,
$password as xs:string
) as empty-sequence()</pre>
=Updates=
'''Important note:''' All functions in this section are ''updating functions'': they will not be immediately executed, but queued on the [[XQuery Update#Pending Update List|Pending Update List]], which will be processed after the actual query has been evaluated. This means that the order in which the functions are specified in the query usually does usually not reflect the order in which the code will be evaluated.
==user:create==
| width='120' | '''Signature'''
|<pre>user:create(
$name as xs:string, $password as xs:string, $permissions as xs:string* := (), $patterns as xs:string* := (),
$info as element(info) := ()
) as empty-sequence()</pre>
| width='120' | '''Signature'''
|<pre>user:grant(
$name as xs:string, $permissions as xs:string*,
$patterns as xs:string* := ()
) as empty-sequence()</pre>
| width='120' | '''Signature'''
|<pre>user:drop(
$name as xs:string,
$patterns as xs:string* := ()
) as empty-sequence()</pre>
| width='120' | '''Signature'''
|<pre>user:alter(
$name as xs:string,
$newname as xs:string
) as empty-sequence()</pre>
| width='120' | '''Signature'''
|<pre>user:password(
$name as xs:string,
$password as xs:string
) as empty-sequence()</pre>
| width='120' | '''Signature'''
|<pre>user:update-info(
$info as element(info),
$name as xs:string := ()
) as empty-sequence()</pre>
Bureaucrats, editor, reviewer, Administrators
13,554

edits

Navigation menu