public final class User extends Object
Modifier and Type | Method and Description |
---|---|
EnumMap<Algorithm,EnumMap<Code,String>> |
alg()
Returns algorithms.
|
String |
code(Algorithm alg,
Code code)
Returns the specified code.
|
boolean |
has(Perm prm)
Tests if the user has the specified permission.
|
boolean |
has(Perm prm,
String db)
Tests if the user has the specified permission.
|
Map<String,Perm> |
locals()
Returns the local permissions.
|
boolean |
matches(String password)
Computes the hash from the specified password and checks if it is correct.
|
String |
name()
Returns the user name.
|
void |
perm(Perm prm,
String pattern)
Sets the permission.
|
Perm |
perm(String db)
Returns the global permission, or the permission for the specified database.
|
String |
toString() |
public String name()
public String code(Algorithm alg, Code code)
alg
- used algorithmcode
- code to be returnednull
if code does not existpublic Perm perm(String db)
db
- database (can be null
)public void perm(Perm prm, String pattern)
prm
- permissionpattern
- database pattern (can be null
)public boolean has(Perm prm)
prm
- permission to be checkedpublic boolean has(Perm prm, String db)
prm
- permission to be checkeddb
- database (can be null
)public boolean matches(String password)
password
- (plain text)Copyright © 2005–2015 BaseX Team. All rights reserved.