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

Class UserManager



  • public final class UserManager
    extends java.lang.Object
    Manages the User objects for a Database instance. The special users PUBLIC_USER_NAME and SYSTEM_AUTHORIZATION_NAME are created and managed here. SYSTEM_AUTHORIZATION_NAME is also special in that the name is not kept in the user "list" (PUBLIC_USER_NAME is kept in the list because it's needed by MetaData routines via "listVisibleUsers(x, true)").
    Since:
    1.7.2
    See Also:
    User
    • Constructor Detail

      • UserManager

        public UserManager(Database database)
        Construction happens once for each Database instance. Creates special users PUBLIC_USER_NAME and SYSTEM_AUTHORIZATION_NAME. Sets up association with the GranteeManager for this database.
    • Method Detail

      • createUser

        public User createUser(Session session,
                               HsqlNameManager.HsqlName name,
                               java.lang.String password,
                               boolean isDigest)
        Creates a new User object under management of this object.

        A set of constraints regarding user creation is imposed:

        1. If the specified name is null, then an ASSERTION_FAILED exception is thrown stating that the name is null.
        2. If this object's collection already contains an element whose name attribute equals the name argument, then a GRANTEE_ALREADY_EXISTS exception is thrown. (This will catch attempts to create Reserved grantee names).
      • setPassword

        public void setPassword(Session session,
                                User user,
                                java.lang.String password,
                                boolean isDigest)
      • checkComplexity

        public boolean checkComplexity(Session session,
                                       java.lang.String password)
      • dropUser

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

        A successful drop action consists of:

        • removing the User object with the specified name from the set.
        • revoking all rights from the removed User
          (this ensures that in case there are still references to the just dropped User object, those references cannot be used to erronously access database objects).

      • createFirstUser

        public void createFirstUser(java.lang.String username,
                                    java.lang.String password)
      • getUser

        public User getUser(java.lang.String name,
                            java.lang.String password)
        Returns the User object with the specified name and password from this object's set.
      • getUsers

        public HashMappedList getUsers()
        Retrieves this object's set of User objects as an associative list.
      • exists

        public boolean exists(java.lang.String name)
      • get

        public User get(java.lang.String name)
        Returns the User object identified by the name argument.
      • listVisibleUsers

        public HsqlArrayList listVisibleUsers(Session session)
        Retrieves the User objects representing the database users that are visible to the User object represented by the session argument.

        If the session argument's User object attribute has isAdmin() true (directly or by virtue of a Role), then all of the User objects in this collection are considered visible. Otherwise, only this object's special PUBLIC User object attribute and the session User object, if it exists in this collection, are considered visible.

        Parameters:
        session - The Session object used to determine visibility
        Returns:
        a list of User objects visible to the User object contained by the session argument.
      • getSysUser

        public User getSysUser()
        Returns the specially constructed SYSTEM_AUTHORIZATION_NAME User object for the current Database object.
        Returns:
        the SYS_AUTHORIZATION_NAME User object
      • removeSchemaReference

        public void removeSchemaReference(java.lang.String schemaName)
      • setPasswordCheckFunction

        public void setPasswordCheckFunction(Routine function)
      • setExtAuthenticationFunction

        public void setExtAuthenticationFunction(Routine function)
      • getInitialSchemaSQL

        public java.lang.String[] getInitialSchemaSQL()
      • getAuthenticationSQL

        public java.lang.String[] getAuthenticationSQL()

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.