Package org.h2.engine
Class RightOwner
java.lang.Object
org.h2.engine.DbObject
org.h2.engine.RightOwner
- All Implemented Interfaces:
org.h2.util.HasSQL
A right owner (sometimes called principal).
-
Field Summary
Fields inherited from class org.h2.engine.DbObject
AGGREGATE, comment, COMMENT, CONSTANT, CONSTRAINT, database, DOMAIN, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, SYNONYM, TABLE_OR_VIEW, trace, TRIGGER, USER
Fields inherited from interface org.h2.util.HasSQL
ADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS
-
Constructor Summary
ModifierConstructorDescriptionprotected
RightOwner
(Database database, int id, String name, int traceModuleId) -
Method Summary
Modifier and TypeMethodDescriptionfinal void
Check that this right owner does not own any schema.getRightForObject
(DbObject object) Get the 'grant schema' right of this object.getRightForRole
(Role role) Get the 'grant role' right of this object.void
grantRight
(DbObject object, Right right) Grant a right for the given table.void
Grant a role to this object.boolean
isRoleGranted
(Role grantedRole) Check if a role has been granted for this right owner.void
Rename the object.void
Remove all the temporary rights granted on rolesMethods inherited from class org.h2.engine.DbObject
checkRename, getChildren, getComment, getCreateSQL, getCreateSQLForCopy, getCreateSQLForMeta, getDatabase, getDropSQL, getId, getModificationId, getName, getSQL, getSQL, getType, invalidate, isTemporary, isValid, removeChildrenAndResources, setComment, setModified, setObjectName, setTemporary, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.h2.util.HasSQL
getTraceSQL
-
Constructor Details
-
RightOwner
-
-
Method Details
-
rename
Description copied from class:DbObject
Rename the object. -
isRoleGranted
Check if a role has been granted for this right owner.- Parameters:
grantedRole
- the role- Returns:
- true if the role has been granted
-
grantRight
Grant a right for the given table. Only one right object per table is supported.- Parameters:
object
- the object (table or schema)right
- the right
-
grantRole
Grant a role to this object.- Parameters:
role
- the roleright
- the right to grant
-
revokeTemporaryRightsOnRoles
public void revokeTemporaryRightsOnRoles()Remove all the temporary rights granted on roles -
getRightForObject
Get the 'grant schema' right of this object.- Parameters:
object
- the granted object (table or schema)- Returns:
- the right or null if the right has not been granted
-
getRightForRole
Get the 'grant role' right of this object.- Parameters:
role
- the granted role- Returns:
- the right or null if the right has not been granted
-
checkOwnsNoSchemas
public final void checkOwnsNoSchemas()Check that this right owner does not own any schema. An exception is thrown if it owns one or more schemas.- Throws:
org.h2.message.DbException
- if this right owner owns a schema
-