| java.lang.Object org.hsqldb.UserManager
UserManager | class UserManager implements GrantConstants(Code) | | 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)").
Partly based on Hypersonic code.
author: Thomas Mueller (Hypersonic SQL Group) author: boucherb@users author: fredt@users version: 1.8.0 since: 1.7.2 See Also: User |
Field Summary | |
User | sysUser We keep a link to the SYSTEM_AUTHORIZATION_NAME user because it is
the only User with no entry in the User map. |
Constructor Summary | |
| UserManager(Database database) Construction happens once for each Database object. |
Method Summary | |
User | createUser(String name, String password) Creates a new User object under management of this object. | void | dropUser(String name) Attempts to drop a User object with the specified name
from this object's set. | boolean | exists(String name) | User | get(String name) Returns the User object identified by the
name argument. | static String[] | getRightsArray(int rights) | User | getSysUser() Returns the specially constructed
SYSTEM_AUTHORIZATION_NAME
User object for the current Database object.
throws: HsqlException - - if the specified Database has no SYS_AUTHORIZATION_NAME User object. | User | getUser(String name, String password) Returns the User object with the specified name and
password from this object's set. | HashMappedList | getUsers() Retrieves this object's set of User objects as
an HsqlArrayList. | HsqlArrayList | listVisibleUsers(Session session, boolean andPublicUser) Retrieves the User objects representing the database
users that are visible to the User object
represented by the session argument. | void | removeDbObject(Object dbobject) Removes all rights mappings for the database object identified by
the dbobject argument from all Grantee objects in the set. | public synchronized void | removeSchemaReference(Schema schema) |
sysUser | User sysUser(Code) | | We keep a link to the SYSTEM_AUTHORIZATION_NAME user because it is
the only User with no entry in the User map.
|
UserManager | UserManager(Database database) throws HsqlException(Code) | | Construction happens once for each Database object.
Creates special users PUBLIC_USER_NAME and SYSTEM_AUTHORIZATION_NAME.
Sets up association with the GranteeManager for this database.
|
createUser | User createUser(String name, String password) throws HsqlException(Code) | | Creates a new User object under management of this object.
A set of constraints regarding user creation is imposed:
- If the specified name is null, then an
ASSERTION_FAILED exception is thrown stating that
the name is null.
- 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).
|
dropUser | void dropUser(String name) throws HsqlException(Code) | | 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 object
(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).
|
getRightsArray | static String[] getRightsArray(int rights)(Code) | | |
getSysUser | User getSysUser()(Code) | | Returns the specially constructed
SYSTEM_AUTHORIZATION_NAME
User object for the current Database object.
throws: HsqlException - - if the specified Database has no SYS_AUTHORIZATION_NAME User object. the SYS_AUTHORIZATION_NAME User object |
getUsers | HashMappedList getUsers()(Code) | | Retrieves this object's set of User objects as
an HsqlArrayList.
|
listVisibleUsers | HsqlArrayList listVisibleUsers(Session session, boolean andPublicUser)(Code) | | 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 determinevisibility Parameters: andPublicUser - whether to include the special PUBLIC User object in the retrieved list a list of User objects visible tothe User object contained by thesession argument. |
removeDbObject | void removeDbObject(Object dbobject)(Code) | | Removes all rights mappings for the database object identified by
the dbobject argument from all Grantee objects in the set.
|
removeSchemaReference | public synchronized void removeSchemaReference(Schema schema)(Code) | | |
|
|