Difference between revisions of "User Management"

From BaseX Documentation
Jump to navigation Jump to search
Line 13: Line 13:
 
===Granting write permission on database 'factbook' to user 'test'===  
 
===Granting write permission on database 'factbook' to user 'test'===  
 
<code>&gt; GRANT write ON factbook TO test</code>  
 
<code>&gt; GRANT write ON factbook TO test</code>  
 
 
<p>  
 
<p>  
 
Note that local permissions overwrite global permissions.
 
Note that local permissions overwrite global permissions.
Line 29: Line 28:
 
===Showing local permissions on database 'factbook'===  
 
===Showing local permissions on database 'factbook'===  
 
<code>&gt; SHOW USERS ON factbook</code>
 
<code>&gt; SHOW USERS ON factbook</code>
 +
 +
===Deleting of user 'test'===
 +
<code>&gt; Delete User test</code>
  
 
==Permissions hierarchy==
 
==Permissions hierarchy==

Revision as of 13:22, 6 December 2010

User Management

Creating user 'test' with password 'test'

> CREATE USER test test

As global permissions, you can set 'none', 'read', 'write', 'create' and 'admin':

Revoking all global permissions from user 'test'

> GRANT none TO test

Valid local permissions are 'none', 'read' and 'write':

Granting write permission on database 'factbook' to user 'test'

> GRANT write ON factbook TO test

Note that local permissions overwrite global permissions. As a consequence, the 'test' user will only be allowed to access (i.e., read and write) the 'factbook' database. If no local permissions are set, the global rights are inherited.

Admin permissions are needed to review the user permissions:

Showing global permissions

> SHOW USERS

Showing local permissions on database 'factbook'

> SHOW USERS ON factbook

Deleting of user 'test'

> Delete User test

Permissions hierarchy

Permissions hierarchy

Commands and Permissions table