User

Represents a user object.

Methods
void checkAdmin()
Checks if this user has admin rights.
void checkAdmin()
Checks if this user has admin rights. An exception is thrown if user doesn't have them.
Throws:
DbException - if this user is not an admin
void checkSchemaAdmin()
Checks if this user has schema admin rights for every schema.
void checkSchemaAdmin()
Checks if this user has schema admin rights for every schema. An exception is thrown if user doesn't have them.
Throws:
DbException - if this user is not a schema admin
void checkSchemaOwner(Schema schema)
Checks if this user has schema owner rights for the specified schema.
void checkSchemaOwner(Schema schema)
Checks if this user has schema owner rights for the specified schema. An exception is thrown if user doesn't have them.
Parameters:
schema - the schema
Throws:
DbException - if this user is not a schema owner
void checkTableRight(Table table, int rightMask)
Checks that this user has the given rights for the specified table.
void checkTableRight(Table table, int rightMask)
Checks that this user has the given rights for the specified table.
Parameters:
table - the table
rightMask - the rights required
Throws:
DbException - if this user does not have the required rights
ArrayList getChildren()
ArrayList getChildren()
String getCreateSQL()
String getCreateSQL()
String getCreateSQL(boolean password)
Get the CREATE SQL statement for this object.
String getCreateSQL(boolean password)
Get the CREATE SQL statement for this object.
Parameters:
password - true if the password (actually the salt and hash) should be returned
Returns:
the SQL statement
String getCreateSQLForCopy(Table table, String quotedName)
String getCreateSQLForCopy(Table table, String quotedName)
int getType()
int getType()
boolean hasTableRight(Table table, int rightMask)
See if this user has the given rights for this database object.
boolean hasTableRight(Table table, int rightMask)
See if this user has the given rights for this database object.
Parameters:
table - the database object, or null for schema-only check
rightMask - the rights required
Returns:
true if the user has the rights
boolean isAdmin()
boolean isAdmin()
void removeChildrenAndResources(SessionLocal session)
void removeChildrenAndResources(SessionLocal session)
void setAdmin(boolean admin)
void setAdmin(boolean admin)
void setSaltAndHash(byte[] salt, byte[] hash)
Set the salt and hash of the password for this user.
void setSaltAndHash(byte[] salt, byte[] hash)
Set the salt and hash of the password for this user.
Parameters:
salt - the salt
hash - the password hash
void setUserPasswordHash(byte[] userPasswordHash)
Set the user name password hash.
void setUserPasswordHash(byte[] userPasswordHash)
Set the user name password hash. A random salt is generated as well. The parameter is filled with zeros after use.
Parameters:
userPasswordHash - the user name password hash