org.h2.engine
Class RightOwner
java.lang.Object
org.h2.engine.DbObjectBase
org.h2.engine.RightOwner
- All Implemented Interfaces:
- DbObject
- Direct Known Subclasses:
- Role, User
public abstract class RightOwner
- extends DbObjectBase
A right owner (sometimes called principal).
Fields inherited from interface org.h2.engine.DbObject |
AGGREGATE, COMMENT, CONSTANT, CONSTRAINT, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, TABLE_OR_VIEW, TRIGGER, USER, USER_DATATYPE |
Constructor Summary |
protected |
RightOwner(Database database,
int id,
java.lang.String name,
java.lang.String traceModule)
|
Methods inherited from class org.h2.engine.DbObjectBase |
checkRename, getChildren, getComment, getCreateSQL, getDatabase, getDropSQL, getId, getModificationId, getName, getSQL, initDbObjectBase, invalidate, isTemporary, removeChildrenAndResources, rename, setComment, setModified, setObjectName, setTemporary, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
RightOwner
protected RightOwner(Database database,
int id,
java.lang.String name,
java.lang.String traceModule)
isRoleGranted
public boolean isRoleGranted(Role grantedRole)
- Check if a role has been granted for this right owner.
- Parameters:
grantedRole
- the role
- Returns:
- true if the role has been granted
grantRight
public void grantRight(Table table,
Right right)
- Grant a right for the given table. Only one right object per table is
supported.
- Parameters:
table
- the tableright
- the right
grantRole
public void grantRole(Role role,
Right right)
- Grant a role to this object.
- Parameters:
role
- the roleright
- the right to grant
getRightForTable
public Right getRightForTable(Table table)
- Get the 'grant table' right of this object.
- Parameters:
table
- the granted table
- Returns:
- the right or null if the right has not been granted
getRightForRole
public Right getRightForRole(Role role)
- 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