Class Hierarchy        Index

Class COM.cloudscape.database.UserUtility

java.lang.Object
   |
   +----COM.cloudscape.database.UserUtility

public abstract class UserUtility
extends Object
Copyright © 1999, Cloudscape, Inc. All rights reserved.

This utility class provides static methods for managing users and their authorization in a Cloudscape database.

The methods in this class can only be used within an SQL-J statement. Using the methods in application-side Java code results in Exceptions being thrown.

Cloudscape reserves the right to change, rename, or remove this interface at any time.


Variable Index

 o FULL_ACCESS_PERMISSION
Enumeration value for full access permission ("FULL_ACCESS_PERMISSION").
 o READ_ACCESS_PERMISSION
Enumeration value for read access permission ("READ_ACCESS_PERMISSION").

Method Index

 o add(String, String)
Add a user to the database.
 o drop(String)
Drop a user from the database.
 o getPermission(String)
Return a user's permission in a database.
 o set(String, String)
Set the permission for a user in the database.

Variables

 o READ_ACCESS_PERMISSION
 public static final String READ_ACCESS_PERMISSION
Enumeration value for read access permission ("READ_ACCESS_PERMISSION").

 o FULL_ACCESS_PERMISSION
 public static final String FULL_ACCESS_PERMISSION
Enumeration value for full access permission ("FULL_ACCESS_PERMISSION").

Methods

 o add
 public static final void add(String userName,
                              String permission) throws StandardException
Add a user to the database.

Only users with FULL_ACCESS_PERMISSION may use this.

Parameters:
userName - the user's name. A valid possibly delimited SQL identifier.
permission - READ_ACCESS_PERMISSION or FULL_ACCESS_PERMISSION.
Throws: StandardException
thrown if this fails.
 o set
 public static final void set(String userName,
                              String permission) throws StandardException
Set the permission for a user in the database.

Only users with FULL_ACCESS_PERMISSION may use this.

Parameters:
userName - the user's name. A valid possibly delimited SQL identifier.
permission - READ_ACCESS_PERMISSION or FULL_ACCESS_PERMISSION.
Throws: StandardException
thrown if this fails.
 o drop
 public static final void drop(String userName) throws StandardException
Drop a user from the database.

Only users with FULL_ACCESS_PERMISSION may use this.

Parameters:
userName - the user's name. A valid possibly delimited SQL identifier.
Returns:
if the user existed in the database and was dropped return true. If the user did not exist in the database to start with return false.
Throws: StandardException
thrown if this fails or the user being dropped does not exist.
 o getPermission
 public static final String getPermission(String userName) throws StandardException
Return a user's permission in a database.

Users with FULL_ACCESS_PERMISSION or READ_ACCESS_PERMISSION may use this.

Parameters:
userName - the user's name. A valid possibly delimited SQL identifier.
Returns:
FULL_ACCESS_PERMISSION if the user is in "cloudscape.database.fullAccessUsers", READ_ACCESS_PERMISSION if the user is in "cloudscape.database.readOnlyAccessUsers", or null if the user is not in either list.
Throws: StandardException
thrown if this fails.

  Class Hierarchy        Index