Package org.basex.core.users
Class User
java.lang.Object
org.basex.core.users.User
This class contains information on a single user.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the specified code.voidDrops the specified database pattern.booleanTests if the user has the specified permission.booleanTests if the user has the specified permission.info()Returns the info element.voidSets the info element.booleanComputes the hash from the specified password and checks if it is correct.name()Returns the user name.voidSets the user name.voidComputes new password hashes.Returns the global permission, or the permission for the specified database.Sets the global permission.Sets the permission.toXML(QueryContext qc) Returns user information as XML.
-
Constructor Details
-
User
Constructor.- Parameters:
name- user namepassword- password
-
-
Method Details
-
toXML
Returns user information as XML.- Parameters:
qc- query context (nullif element will only be created for serialization)- Returns:
- user element
-
name
Sets the user name.- Parameters:
nm- name
-
drop
Drops the specified database pattern.- Parameters:
pattern- database pattern
-
name
Returns the user name.- Returns:
- name
-
password
Computes new password hashes.- Parameters:
password- password (plain text)
-
code
Returns the specified code.- Parameters:
alg- used algorithmcode- code to be returned- Returns:
- code, or
nullif code does not exist
-
perm
Returns the global permission, or the permission for the specified database.- Parameters:
db- database pattern (can benull)- Returns:
- permission
-
perm
Sets the global permission.- Parameters:
prm- permission- Returns:
- self reference
-
perm
Sets the permission.- Parameters:
prm- permissionpattern- database pattern (can be empty)- Returns:
- self reference
-
has
Tests if the user has the specified permission.- Parameters:
prm- permission to be checked- Returns:
- result of check
-
has
Tests if the user has the specified permission.- Parameters:
prm- permission to be checkeddb- database pattern (can benull)- Returns:
- result of check
-
matches
Computes the hash from the specified password and checks if it is correct.- Parameters:
password- (plain text)- Returns:
- name
-
info
Returns the info element.- Returns:
- info element (can be
null)
-
info
Sets the info element.- Parameters:
elem- info element
-