public class User extends RightOwner
comment, database, traceAGGREGATE, COMMENT, CONSTANT, CONSTRAINT, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, SYNONYM, TABLE_OR_VIEW, TRIGGER, USER, USER_DATATYPE| Constructor and Description |
|---|
User(Database database,
int id,
java.lang.String userName,
boolean systemUser) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkAdmin()
Check if this user has admin rights.
|
void |
checkOwnsNoSchemas()
Check that this user does not own any schema.
|
void |
checkRename()
Check if this object can be renamed.
|
void |
checkRight(Table table,
int rightMask)
Checks that this user has the given rights for this database object.
|
void |
checkSchemaAdmin()
Check if this user has schema admin rights.
|
java.util.ArrayList<DbObject> |
getChildren()
Get the list of dependent children (for tables, this includes indexes and
so on).
|
java.lang.String |
getCreateSQL()
Build a SQL statement to re-create this object.
|
java.lang.String |
getCreateSQL(boolean password)
Get the CREATE SQL statement for this object.
|
java.lang.String |
getCreateSQLForCopy(Table table,
java.lang.String quotedName)
Build a SQL statement to re-create the object, or to create a copy of the
object with a different name or referencing a different table
|
java.lang.String |
getDropSQL()
Build a SQL statement to drop this object.
|
int |
getType()
Get the object type.
|
boolean |
hasRight(Table table,
int rightMask)
See if this user has the given rights for this database object.
|
boolean |
isAdmin() |
void |
removeChildrenAndResources(Session session)
Remove all dependent objects and free all resources (files, blocks in
files) of this object.
|
void |
setAdmin(boolean admin) |
void |
setSaltAndHash(byte[] salt,
byte[] hash)
Set the salt and hash of the password for this user.
|
void |
setUserPasswordHash(byte[] userPasswordHash)
Set the user name password hash.
|
getRightForObject, getRightForRole, grantRight, grantRole, isRoleGrantedgetComment, getDatabase, getId, getModificationId, getName, getSQL, initDbObjectBase, invalidate, isTemporary, isValid, rename, setComment, setModified, setObjectName, setTemporary, toStringpublic User(Database database, int id, java.lang.String userName, boolean systemUser)
public void setAdmin(boolean admin)
public boolean isAdmin()
public void setSaltAndHash(byte[] salt,
byte[] hash)
salt - the salthash - the password hashpublic void setUserPasswordHash(byte[] userPasswordHash)
userPasswordHash - the user name password hashpublic java.lang.String getCreateSQLForCopy(Table table, java.lang.String quotedName)
DbObjecttable - the new tablequotedName - the quoted namepublic java.lang.String getCreateSQL()
DbObjectBasegetCreateSQL in interface DbObjectgetCreateSQL in class DbObjectBasepublic java.lang.String getDropSQL()
DbObjectBasegetDropSQL in interface DbObjectgetDropSQL in class DbObjectBasepublic void checkRight(Table table, int rightMask)
table - the database objectrightMask - the rights requiredDbException - if this user does not have the required rightspublic boolean hasRight(Table table, int rightMask)
table - the database object, or null for schema-only checkrightMask - the rights requiredpublic java.lang.String getCreateSQL(boolean password)
password - true if the password (actually the salt and hash) should
be returnedpublic void checkAdmin()
DbException - if this user is not an adminpublic void checkSchemaAdmin()
DbException - if this user is not a schema adminpublic int getType()
DbObjectpublic java.util.ArrayList<DbObject> getChildren()
DbObjectgetChildren in interface DbObjectgetChildren in class DbObjectBasepublic void removeChildrenAndResources(Session session)
DbObjectBaseremoveChildrenAndResources in interface DbObjectremoveChildrenAndResources in class DbObjectBasesession - the sessionpublic void checkRename()
DbObjectBasecheckRename in interface DbObjectcheckRename in class DbObjectBasepublic void checkOwnsNoSchemas()
DbException - if this user owns a schema