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 referred 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.
| Modifier and Type | Field and Description |
|---|---|
| private MultiValueHashMap | directRightsMap
map with database object identifier keys and access privileges values |
| pack-priv HashMap | fullRightsMap
contains rights granted direct, or via roles, except those of PUBLIC |
| private MultiValueHashMap | grantedRightsMap
map with database object identifier keys and access privileges values |
| protected GranteeManager | granteeManager
Needed only to give access to the roles for this database |
| protected HsqlNameManager. | granteeName
Grantee name. |
| private boolean | isAdmin
true if this grantee has database administrator priv by any means. |
| private boolean | isAdminDirect
true if this grantee has database administrator priv directly (i.e., not by membership in any role) |
| pack-priv boolean | isPublic
true if this grantee is PUBLIC. |
| pack-priv boolean | |
| pack-priv boolean | isSystem
true if this grantee is _SYSTEM. |
| protected Right | |
| pack-priv OrderedHashSet | roles
These are the DIRECT roles. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private OrderedHashSet | Returns: Given role with new elements added.Adds to given Set this.sName plus all roles and nested roles. |
| pack-priv void | addToFullRights(HashMap<HsqlNameManager.
Full or partial rights are added to existing |
| private void | addToFullRights(MultiValueHashMap<HsqlNameManager.
Full or partial rights are added to existing |
| public boolean | |
| public boolean | |
| public Right | |
| public void | |
| public Right | |
| public Right | |
| public Right | |
| public void | checkSchemaUpdateOrGrantRights(HsqlNameManager.
Checks if this object can modify schema objects or grant access rights to them. |
| public Right | checkSelect(SchemaObject object, boolean[] checkList)
Checks if a right represented by the methods have been granted on the specified database object. |
| public Right | |
| public Right | |
| pack-priv void | |
| public OrderedHashSet | |
| pack-priv Right | |
| public OrderedHashSet | |
| public OrderedHashSet | |
| public HsqlNameManager. | |
| public long | |
| public OrderedHashSet | |
| public OrderedHashSet | |
| public OrderedHashSet | |
| public OrderedHashSet | |
| public OrderedHashSet | |
| public HsqlNameManager. | |
| public Grantee | |
| private MultiValueHashMap | getRights()
Retrieves the map object that represents the rights that have been granted on database objects. |
| pack-priv HsqlArrayList | |
| public HsqlNameManager. | |
| public String | |
| public int | |
| pack-priv void | grant(HsqlNameManager.
Grants the specified rights on the specified database object. |
| pack-priv void | |
| private void | |
| public boolean | |
| public boolean | |
| public boolean | |
| private boolean | |
| public boolean | hasSchemaUpdateOrGrantRights(HsqlNameManager.
Checks if this object can modify schema objects or grant access rights to them. |
| public boolean | |
| public boolean | isAccessible(SchemaObject object)
returns true if grantee has any privilege (to any column) of the object |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| pack-priv void | revoke(SchemaObject object, Right right, Grantee grantor, boolean grantOption)
Revokes the specified rights on the specified database object. |
| pack-priv void | |
| pack-priv void | |
| private void | |
| private String | |
| pack-priv void | |
| pack-priv void | updateAllRights()
Method used with all Grantee objects to set the full set of rights according to those inherited form ROLE Grantee objects and those granted to the object itself. |
| pack-priv boolean | Returns: true if this Grantee has possibly changed as a resulta modified, revoked or dropped role. role)Recursive method used with ROLE Grantee objects to set the fullRightsMap and admin flag for all the roles. |
| public OrderedHashSet |
| directRightsMap | back to summary |
|---|---|
| private MultiValueHashMap<HsqlNameManager. map with database object identifier keys and access privileges values | |
| fullRightsMap | back to summary |
|---|---|
| pack-priv HashMap<HsqlNameManager. contains rights granted direct, or via roles, except those of PUBLIC | |
| grantedRightsMap | back to summary |
|---|---|
| private MultiValueHashMap<HsqlNameManager. map with database object identifier keys and access privileges values | |
| granteeManager | back to summary |
|---|---|
| protected GranteeManager granteeManager Needed only to give access to the roles for this database | |
| granteeName | back to summary |
|---|---|
| protected HsqlNameManager. Grantee name. | |
| isAdmin | back to summary |
|---|---|
| private boolean isAdmin true if this grantee has database administrator priv by any means. | |
| isAdminDirect | back to summary |
|---|---|
| private boolean isAdminDirect true if this grantee has database administrator priv directly (i.e., not by membership in any role) | |
| isPublic | back to summary |
|---|---|
| pack-priv boolean isPublic true if this grantee is PUBLIC. | |
| isRole | back to summary |
|---|---|
| pack-priv boolean isRole | |
| isSystem | back to summary |
|---|---|
| pack-priv boolean isSystem true if this grantee is _SYSTEM. | |
| ownerRights | back to summary |
|---|---|
| protected Right ownerRights | |
| roles | back to summary |
|---|---|
| pack-priv OrderedHashSet<Grantee> roles These are the DIRECT roles. Each of these may contain nested roles | |
| Grantee | back to summary |
|---|---|
| pack-priv Grantee(HsqlNameManager. Constructor. | |
| addGranteeAndRoles | back to summary |
|---|---|
| private OrderedHashSet Adds to given Set this.sName plus all roles and nested roles.
| |
| addToFullRights | back to summary |
|---|---|
| pack-priv void addToFullRights(HashMap<HsqlNameManager. Full or partial rights are added to existing | |
| addToFullRights | back to summary |
|---|---|
| private void addToFullRights(MultiValueHashMap<HsqlNameManager. Full or partial rights are added to existing | |
| canChangeAuthorisation | back to summary |
|---|---|
| public boolean canChangeAuthorisation() Returns true if this Grantee can change to a different user. | |
| canPerformScriptOps | back to summary |
|---|---|
| public boolean canPerformScriptOps() Returns true if this Grantee can change to a different user. | |
| checkAccess | back to summary |
|---|---|
| public Right checkAccess(SchemaObject object) | |
| checkAdmin | back to summary |
|---|---|
| public void checkAdmin() Checks whether this Grantee has administrative privs either directly or indirectly. Otherwise it throws. | |
| checkDelete | back to summary |
|---|---|
| public Right checkDelete(SchemaObject object) | |
| checkInsert | back to summary |
|---|---|
| public Right checkInsert(SchemaObject object, boolean[] checkList) | |
| checkReferences | back to summary |
|---|---|
| public Right checkReferences(SchemaObject object, boolean[] checkList) | |
| checkSchemaUpdateOrGrantRights | back to summary |
|---|---|
| public void checkSchemaUpdateOrGrantRights(HsqlNameManager. Checks if this object can modify schema objects or grant access rights to them. | |
| checkSelect | back to summary |
|---|---|
| public Right 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. | |
| checkTrigger | back to summary |
|---|---|
| public Right checkTrigger(SchemaObject object, boolean[] checkList) | |
| checkUpdate | back to summary |
|---|---|
| public Right checkUpdate(SchemaObject object, boolean[] checkList) | |
| clearPrivileges | back to summary |
|---|---|
| pack-priv void clearPrivileges() Revokes all rights from this Grantee object. The map is cleared and the database administrator role attribute is set false. | |
| getAllDirectPrivileges | back to summary |
|---|---|
| public OrderedHashSet | |
| getAllGrantableRights | back to summary |
|---|---|
| pack-priv Right getAllGrantableRights(HsqlNameManager. | |
| getAllGrantedPrivileges | back to summary |
|---|---|
| public OrderedHashSet | |
| getAllRoles | back to summary |
|---|---|
| public OrderedHashSet Gets direct and indirect roles. | |
| getCatalogName | back to summary |
|---|---|
| public HsqlNameManager. Implements org. | |
| getChangeTimestamp | back to summary |
|---|---|
| public long getChangeTimestamp() Implements org. | |
| getColumnsForAllPrivileges | back to summary |
|---|---|
| public OrderedHashSet | |
| getDirectRoles | back to summary |
|---|---|
| public OrderedHashSet Gets direct roles, not roles nested within them. | |
| getDirectRolesWithPublic | back to summary |
|---|---|
| public OrderedHashSet Gets direct roles and public role, not roles nested within them. | |
| getGranteeAndAllRoles | back to summary |
|---|---|
| public OrderedHashSet | |
| getGranteeAndAllRolesWithPublic | back to summary |
|---|---|
| public OrderedHashSet | |
| getName | back to summary |
|---|---|
| public HsqlNameManager. Implements org. | |
| getOwner | back to summary |
|---|---|
| public Grantee getOwner() Implements org. | |
| getRights | back to summary |
|---|---|
| private MultiValueHashMap Retrieves the map object that represents the rights that have been granted on database objects. The map has keys and values with the following interpretation:
| |
| getRightsSQL | back to summary |
|---|---|
| pack-priv HsqlArrayList | |
| getSchemaName | back to summary |
|---|---|
| public HsqlNameManager. Implements org. | |
| getSQL | back to summary |
|---|---|
| public String getSQL() Implements org. | |
| getType | back to summary |
|---|---|
| public int getType() Implements org. | |
| grant | back to summary |
|---|---|
| pack-priv void grant(HsqlNameManager. Grants the specified rights on the specified database object. Keys stored in rightsMap for database tables are their HsqlName attribute. This allows rights to persist when a table is renamed. | |
| grant | back to summary |
|---|---|
| pack-priv void grant(Grantee role) Grant a role | |
| grantToAll | back to summary |
|---|---|
| private void grantToAll(HsqlNameManager. | |
| hasColumnRights | back to summary |
|---|---|
| public boolean hasColumnRights(SchemaObject table, int[] columnMap) | |
| hasNonSelectTableRight | back to summary |
|---|---|
| public boolean hasNonSelectTableRight(SchemaObject table) | |
| hasRole | back to summary |
|---|---|
| public boolean hasRole(Grantee role) | |
| hasRoleDirect | back to summary |
|---|---|
| private boolean hasRoleDirect(Grantee role) | |
| hasSchemaUpdateOrGrantRights | back to summary |
|---|---|
| public boolean hasSchemaUpdateOrGrantRights(HsqlNameManager. Checks if this object can modify schema objects or grant access rights to them. | |
| isAccessible | back to summary |
|---|---|
| public boolean isAccessible(HsqlNameManager. | |
| isAccessible | back to summary |
|---|---|
| public boolean isAccessible(SchemaObject object) returns true if grantee has any privilege (to any column) of the object | |
| isAccessible | back to summary |
|---|---|
| public boolean isAccessible(HsqlNameManager. | |
| isAdmin | back to summary |
|---|---|
| public boolean isAdmin() Returns true if this Grantee has administrative privs either directly or indirectly. | |
| isFullyAccessibleByRole | back to summary |
|---|---|
| public boolean isFullyAccessibleByRole(HsqlNameManager. | |
| isGrantable | back to summary |
|---|---|
| public boolean isGrantable(SchemaObject object, Right right) | |
| isGrantable | back to summary |
|---|---|
| public boolean isGrantable(Grantee role) | |
| isPublic | back to summary |
|---|---|
| public boolean isPublic() Returns true if this grantee object is for the PUBLIC role. | |
| isRole | back to summary |
|---|---|
| public boolean isRole() | |
| isSchemaCreator | back to summary |
|---|---|
| public boolean isSchemaCreator() Returns true if this Grantee can create schemas with own authorization. | |
| isSystem | back to summary |
|---|---|
| public boolean isSystem() | |
| revoke | back to summary |
|---|---|
| pack-priv void revoke(SchemaObject object, Right right, Grantee grantor, boolean grantOption) Revokes the specified rights on the specified database object. If, after removing the specified rights, no rights remain on the database object, then the key/value pair for that object is removed from the rights map | |
| revoke | back to summary |
|---|---|
| pack-priv void revoke(Grantee role) Revoke a direct role only | |
| revokeDbObject | back to summary |
|---|---|
| pack-priv void revokeDbObject(HsqlNameManager. Revokes all rights on the specified database object. This method removes any existing mapping from the rights map | |
| revokeFromAll | back to summary |
|---|---|
| private void revokeFromAll(HsqlNameManager. | |
| roleMapToString | back to summary |
|---|---|
| private String roleMapToString(OrderedHashSet<Grantee> roles) | |
| setAdminDirect | back to summary |
|---|---|
| pack-priv void setAdminDirect() Violates naming convention (for backward compatibility). Should be "setAdminDirect(boolean)". | |
| updateAllRights | back to summary |
|---|---|
| pack-priv void updateAllRights() Method used with all Grantee objects to set the full set of rights according to those inherited form ROLE Grantee objects and those granted to the object itself. | |
| updateNestedRoles | back to summary |
|---|---|
| pack-priv boolean updateNestedRoles(Grantee role) Recursive method used with ROLE Grantee objects to set the fullRightsMap and admin flag for all the roles. If a new ROLE is granted to a ROLE Grantee object, the ROLE should first be added to the Set of ROLE Grantee objects (roles) for the grantee. The grantee will be the parameter. If the direct permissions granted to an existing ROLE Grantee is modified no extra initial action is necessary. The existing Grantee will be the parameter. If an existing ROLE is REVOKEed from a ROLE, it should first be removed from the set of ROLE Grantee objects in the containing ROLE. The containing ROLE will be the parameter. If an existing ROLE is DROPped, all its privileges should be cleared first. The ROLE will be the parameter. After calling this method on all other roles, the DROPped role should be removed from all grantees. After the initial modification, this method should be called iteratively on all the ROLE Grantee objects contained in RoleManager. The updateAllRights() method is then called iteratively on all the USER Grantee objects contained in UserManager.
| |
| visibleGrantees | back to summary |
|---|---|
| public OrderedHashSet 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 | |