public final class User extends RightOwner
AGGREGATE, comment, COMMENT, CONSTANT, CONSTRAINT, database, DOMAIN, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, SYNONYM, TABLE_OR_VIEW, trace, TRIGGER, USERADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS| Constructor and Description |
|---|
User(Database database,
int id,
java.lang.String userName,
boolean systemUser) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkAdmin()
Checks if this user has admin rights.
|
void |
checkSchemaAdmin()
Checks if this user has schema admin rights for every schema.
|
void |
checkSchemaOwner(Schema schema)
Checks if this user has schema owner rights for the specified schema.
|
void |
checkTableRight(Table table,
int rightMask)
Checks that this user has the given rights for the specified table.
|
java.util.ArrayList<DbObject> |
getChildren()
Get the list of dependent children (for tables, this includes indexes and
so on).
|
java.lang.String |
getCreateSQL()
Construct the CREATE ...
|
java.lang.String |
getCreateSQL(boolean password)
Get the CREATE SQL statement for this object.
|
int |
getType()
Get the object type.
|
boolean |
hasTableRight(Table table,
int rightMask)
See if this user has the given rights for this database object.
|
boolean |
isAdmin() |
void |
removeChildrenAndResources(SessionLocal session)
Delete all dependent children objects and resources 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.
|
checkOwnsNoSchemas, getRightForObject, getRightForRole, grantRight, grantRole, isRoleGranted, rename, revokeTemporaryRightsOnRolescheckRename, getComment, getCreateSQLForCopy, getCreateSQLForMeta, getDatabase, getDropSQL, getId, getModificationId, getName, getSQL, getSQL, invalidate, isTemporary, isValid, setComment, setModified, setObjectName, setTemporary, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetTraceSQLpublic 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 getCreateSQL()
DbObjectgetCreateSQL in class DbObjectpublic 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 void checkSchemaOwner(Schema schema)
schema - the schemaDbException - if this user is not a schema ownerpublic void checkTableRight(Table table, int rightMask)
table - the tablerightMask - the rights requiredDbException - if this user does not have the required rightspublic boolean hasTableRight(Table table, int rightMask)
table - the database object, or null for schema-only checkrightMask - the rights requiredpublic int getType()
DbObjectpublic java.util.ArrayList<DbObject> getChildren()
DbObjectgetChildren in class DbObjectnullpublic void removeChildrenAndResources(SessionLocal session)
DbObjectremoveChildrenAndResources in class DbObjectsession - the session