Class Grantee
- java.lang.Object
-
- org.hsqldb.rights.Grantee
-
- All Implemented Interfaces:
- SchemaObject
- Direct Known Subclasses:
- User
public class Grantee extends java.lang.Object implements SchemaObject
A Grantee Object holds the name, access and administrative rights for a particular grantee.It supplies the methods used to grant, revoke, test and check a grantee's access rights to other database objects. It also holds a reference to the common PUBLIC User Object, which represent the special user refered to in GRANT ... TO PUBLIC statements.
The check(), isAccessible() and getGrantedClassNames() methods check the rights granted to the PUBLIC User Object, in addition to individually granted rights, in order to decide which rights exist for the user. Method names ending in Direct indicate methods which do not recurse to look through Roles which "this" object is a member of. We use the word "Admin" (e.g., in private variable "admin" and method "isAdmin()) to mean this Grantee has admin priv by any means. We use the word "adminDirect" (e.g., in private variable "adminDirect" and method "isAdminDirect()) to mean this Grantee has admin priv directly.
- Since:
- 1.8.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hsqldb.SchemaObject
SchemaObject.ConstraintTypes, SchemaObject.Deferable, SchemaObject.Nullability, SchemaObject.ParameterModes, SchemaObject.ReferentialAction, SchemaObject.ViewCheckModes
-
-
Field Summary
-
Fields inherited from interface org.hsqldb.SchemaObject
ASSERTION, CATALOG, CHARSET, COLLATION, COLUMN, CONSTRAINT, CURSOR, DOMAIN, emptyArray, FUNCTION, GRANTEE, INDEX, LABEL, PARAMETER, PROCEDURE, ROUTINE, SCHEMA, SEARCH, SEQUENCE, SERVER, SPECIFIC_ROUTINE, SUBQUERY, TABLE, TRANSITION, TRIGGER, TYPE, VARIABLE, VIEW, WRAPPER
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleancanChangeAuthorisation()Returns true if this Grantee can change to a different user.voidcheckAccess(SchemaObject object)voidcheckAdmin()Checks whether this Grantee has administrative privs either directly or indirectly.voidcheckDelete(SchemaObject object)voidcheckInsert(SchemaObject object, boolean[] checkList)voidcheckReferences(SchemaObject object, boolean[] checkList)voidcheckSchemaUpdateOrGrantRights(java.lang.String schemaName)Checks if this object can modify schema objects or grant access rights to them.voidcheckSelect(SchemaObject object, boolean[] checkList)Checks if a right represented by the methods have been granted on the specified database object.voidcheckTrigger(SchemaObject object, boolean[] checkList)voidcheckUpdate(SchemaObject object, boolean[] checkList)voidcompile(Session session, SchemaObject parentObject)OrderedHashSetgetAllDirectPrivileges(SchemaObject object)OrderedHashSetgetAllGrantedPrivileges(SchemaObject object)OrderedHashSetgetAllRoles()Gets direct and indirect roles.HsqlNameManager.HsqlNamegetCatalogName()longgetChangeTimestamp()OrderedHashSetgetColumnsForAllPrivileges(SchemaObject object)OrderedHashSetgetComponents()OrderedHashSetgetDirectRoles()Gets direct roles, not roles nested within them.OrderedHashSetgetGranteeAndAllRoles()OrderedHashSetgetGranteeAndAllRolesWithPublic()HsqlNameManager.HsqlNamegetName()GranteegetOwner()OrderedHashSetgetReferences()HsqlNameManager.HsqlNamegetSchemaName()java.lang.StringgetSQL()intgetType()booleanhasColumnRights(SchemaObject table, int[] columnMap)booleanhasNonSelectTableRight(SchemaObject table)booleanhasRole(Grantee role)booleanhasSchemaUpdateOrGrantRights(java.lang.String schemaName)Checks if this object can modify schema objects or grant access rights to them.booleanisAccessible(HsqlNameManager.HsqlName name)booleanisAccessible(HsqlNameManager.HsqlName name, int privilegeType)booleanisAccessible(SchemaObject object)returns true if grantee has any privilege (to any column) of the objectbooleanisAdmin()Returns true if this Grantee has administrative privs either directly or indirectly.booleanisFullyAccessibleByRole(HsqlNameManager.HsqlName name)booleanisGrantable(Grantee role)booleanisGrantable(SchemaObject object, Right right)booleanisPublic()Returns true if this grantee object is for the PUBLIC role.booleanisRole()booleanisSchemaCreator()Returns true if this Grantee can create schemas with own authorization.booleanisSystem()OrderedHashSetvisibleGrantees()Iteration of all visible grantees, including self.
-
-
-
Method Detail
-
getType
public int getType()
- Specified by:
getTypein interfaceSchemaObject
-
getName
public HsqlNameManager.HsqlName getName()
- Specified by:
getNamein interfaceSchemaObject
-
getSchemaName
public HsqlNameManager.HsqlName getSchemaName()
- Specified by:
getSchemaNamein interfaceSchemaObject
-
getCatalogName
public HsqlNameManager.HsqlName getCatalogName()
- Specified by:
getCatalogNamein interfaceSchemaObject
-
getOwner
public Grantee getOwner()
- Specified by:
getOwnerin interfaceSchemaObject
-
getReferences
public OrderedHashSet getReferences()
- Specified by:
getReferencesin interfaceSchemaObject
-
getComponents
public OrderedHashSet getComponents()
- Specified by:
getComponentsin interfaceSchemaObject
-
compile
public void compile(Session session, SchemaObject parentObject)
- Specified by:
compilein interfaceSchemaObject
-
getSQL
public java.lang.String getSQL()
- Specified by:
getSQLin interfaceSchemaObject
-
getChangeTimestamp
public long getChangeTimestamp()
- Specified by:
getChangeTimestampin interfaceSchemaObject
-
isRole
public boolean isRole()
-
isSystem
public boolean isSystem()
-
getDirectRoles
public OrderedHashSet getDirectRoles()
Gets direct roles, not roles nested within them.
-
getAllRoles
public OrderedHashSet getAllRoles()
Gets direct and indirect roles.
-
getGranteeAndAllRoles
public OrderedHashSet getGranteeAndAllRoles()
-
getGranteeAndAllRolesWithPublic
public OrderedHashSet getGranteeAndAllRolesWithPublic()
-
isAccessible
public boolean isAccessible(HsqlNameManager.HsqlName name, int privilegeType)
-
isAccessible
public boolean isAccessible(SchemaObject object)
returns true if grantee has any privilege (to any column) of the object
-
isAccessible
public boolean isAccessible(HsqlNameManager.HsqlName name)
-
hasRole
public boolean hasRole(Grantee role)
-
getColumnsForAllPrivileges
public OrderedHashSet getColumnsForAllPrivileges(SchemaObject object)
-
getAllDirectPrivileges
public OrderedHashSet getAllDirectPrivileges(SchemaObject object)
-
getAllGrantedPrivileges
public OrderedHashSet getAllGrantedPrivileges(SchemaObject object)
-
checkSelect
public void checkSelect(SchemaObject object, boolean[] checkList)
Checks if a right represented by the methods have been granted on the specified database object.This is done by checking that a mapping exists in the rights map from the dbobject argument. Otherwise, it throws.
-
checkInsert
public void checkInsert(SchemaObject object, boolean[] checkList)
-
checkUpdate
public void checkUpdate(SchemaObject object, boolean[] checkList)
-
checkReferences
public void checkReferences(SchemaObject object, boolean[] checkList)
-
checkTrigger
public void checkTrigger(SchemaObject object, boolean[] checkList)
-
checkDelete
public void checkDelete(SchemaObject object)
-
checkAccess
public void checkAccess(SchemaObject object)
-
checkSchemaUpdateOrGrantRights
public void checkSchemaUpdateOrGrantRights(java.lang.String schemaName)
Checks if this object can modify schema objects or grant access rights to them.
-
hasSchemaUpdateOrGrantRights
public boolean hasSchemaUpdateOrGrantRights(java.lang.String schemaName)
Checks if this object can modify schema objects or grant access rights to them.
-
isGrantable
public boolean isGrantable(SchemaObject object, Right right)
-
isGrantable
public boolean isGrantable(Grantee role)
-
isFullyAccessibleByRole
public boolean isFullyAccessibleByRole(HsqlNameManager.HsqlName name)
-
checkAdmin
public void checkAdmin()
Checks whether this Grantee has administrative privs either directly or indirectly. Otherwise it throws.
-
isAdmin
public boolean isAdmin()
Returns true if this Grantee has administrative privs either directly or indirectly.
-
isSchemaCreator
public boolean isSchemaCreator()
Returns true if this Grantee can create schemas with own authorization.
-
canChangeAuthorisation
public boolean canChangeAuthorisation()
Returns true if this Grantee can change to a different user.
-
isPublic
public boolean isPublic()
Returns true if this grantee object is for the PUBLIC role.
-
visibleGrantees
public OrderedHashSet visibleGrantees()
Iteration of all visible grantees, including self.For grantees with admin, this is all grantees. For regular grantees, this is self plus all roles granted directly or indirectly
-
hasNonSelectTableRight
public boolean hasNonSelectTableRight(SchemaObject table)
-
hasColumnRights
public boolean hasColumnRights(SchemaObject table, int[] columnMap)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG