Documentation of 'org.hsqldb.rights.GranteeManager' Java class
GranteeManager
org.hsqldb.rights

Class GranteeManager



  • public class GranteeManager
    extends java.lang.Object
    Contains a set of Grantee objects, and supports operations for creating, finding, modifying and deleting Grantee objects for a Database; plus Administrative privileges.
    Since:
    1.8.0
    See Also:
    Grantee
    • Constructor Detail

      • GranteeManager

        public GranteeManager(Database database)
        Construct the GranteeManager for a Database. Construct special Grantee objects for _SYSTEM, PUBLIC and DBA, and add them to the Grantee map.
        Parameters:
        database - Only needed to link to the RoleManager later on.
    • Method Detail

      • getDBARole

        public Grantee getDBARole()
      • getSystemRole

        public static Grantee getSystemRole()
      • grant

        public void grant(OrderedHashSet granteeList,
                          SchemaObject dbObject,
                          Right right,
                          Grantee grantor,
                          boolean withGrantOption)
        Grants the rights represented by the rights argument on the database object identified by the dbobject argument to the Grantee object identified by name argument.

        Note: For the dbobject argument, Java Class objects are identified using a String object whose value is the fully qualified name of the Class, while Table and other objects are identified by an HsqlName object. A Table object identifier must be precisely the one obtained by calling table.getName(); if a different HsqlName object with an identical name attribute is specified, then rights checks and tests will fail, since the HsqlName class implements its hashCode and equals methods based on pure object identity, rather than on attribute values.

      • checkGranteeList

        public void checkGranteeList(OrderedHashSet granteeList)
      • grant

        public void grant(java.lang.String granteeName,
                          java.lang.String roleName,
                          Grantee grantor)
        Grant a role to this Grantee.
      • checkRoleList

        public void checkRoleList(java.lang.String granteeName,
                                  OrderedHashSet roleList,
                                  Grantee grantor,
                                  boolean grant)
      • grantSystemToPublic

        public void grantSystemToPublic(SchemaObject object,
                                        Right right)
      • revoke

        public void revoke(java.lang.String granteeName,
                           java.lang.String roleName,
                           Grantee grantor)
        Revoke a role from a Grantee
      • removeDbObject

        public void removeDbObject(HsqlNameManager.HsqlName name)
        Removes all rights mappings for the database object identified by the dbobject argument from all Grantee objects in the set.
      • removeDbObjects

        public void removeDbObjects(OrderedHashSet nameSet)
      • removeGrantee

        public boolean removeGrantee(java.lang.String name)
      • addRole

        public Grantee addRole(HsqlNameManager.HsqlName name)
        Creates a new Role object under management of this object.

        A set of constraints regarding user creation is imposed:

        1. Can't create a role with name same as any right.
        2. If this object's collection already contains an element whose name attribute equals the name argument, then a GRANTEE_ALREADY_EXISTS or ROLE_ALREADY_EXISTS Trace is thrown. (This will catch attempts to create Reserved grantee names).
      • removeNewUser

        public void removeNewUser(HsqlNameManager.HsqlName name)
        Only used for a recently added user with no dependencies
      • getCheckSingleRight

        public static int getCheckSingleRight(java.lang.String right)
      • getRight

        public static int getRight(java.lang.String right)
        Translate a string representation or right(s) into its numeric form.
      • get

        public Grantee get(java.lang.String name)
      • validRightString

        public static boolean validRightString(java.lang.String rightString)
      • isImmutable

        public static boolean isImmutable(java.lang.String name)
      • isReserved

        public static boolean isReserved(java.lang.String name)
      • dropRole

        public void dropRole(java.lang.String name)
        Attempts to drop a Role with the specified name from this object's set.

        A successful drop action consists of:

        • removing the Grantee object with the specified name from the set.

      • getRoleNames

        public Set getRoleNames()
      • getRole

        public Grantee getRole(java.lang.String name)
        Returns Grantee for the named Role
      • isRole

        public boolean isRole(java.lang.String name)
      • getSQL

        public java.lang.String[] getSQL()
      • getRightstSQL

        public java.lang.String[] getRightstSQL()

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.