org.apache.derby.iapi.sql.conn
Interface Authorizer

All Known Implementing Classes:
GenericAuthorizer

public interface Authorizer

The Authorizer verifies a connected user has the authorization to perform a requested database operation using the current connection.

Today no object based authorization is supported.


Field Summary
static int JAR_WRITE_OP
          database jar write operation
static int PROPERTY_WRITE_OP
          database property write operation
static int SQL_ARBITARY_OP
          Any other SQL operation
static int SQL_CALL_OP
          SQL CALL/VALUE operation
static int SQL_DDL_OP
          SQL DDL operation
static int SQL_SELECT_OP
          SQL SELECT operation
static int SQL_WRITE_OP
          SQL write (insert,update,delete) operation
 
Method Summary
 void authorize(int operation)
          Verify the connected user is authorized to perform the requested operation.
 java.lang.String getAuthorizationId()
          Get the Authorization ID for this Authorizer.
 boolean isReadOnlyConnection()
          Get the readOnly status for this authorizer's connection.
 void refresh()
          Refresh this authorizer to reflect a change in the database permissions.
 void setReadOnlyConnection(boolean on, boolean authorize)
          Set the readOnly status for this authorizer's connection.
 

Field Detail

SQL_WRITE_OP

public static final int SQL_WRITE_OP
SQL write (insert,update,delete) operation

See Also:
Constant Field Values

SQL_SELECT_OP

public static final int SQL_SELECT_OP
SQL SELECT operation

See Also:
Constant Field Values

SQL_ARBITARY_OP

public static final int SQL_ARBITARY_OP
Any other SQL operation

See Also:
Constant Field Values

SQL_CALL_OP

public static final int SQL_CALL_OP
SQL CALL/VALUE operation

See Also:
Constant Field Values

SQL_DDL_OP

public static final int SQL_DDL_OP
SQL DDL operation

See Also:
Constant Field Values

PROPERTY_WRITE_OP

public static final int PROPERTY_WRITE_OP
database property write operation

See Also:
Constant Field Values

JAR_WRITE_OP

public static final int JAR_WRITE_OP
database jar write operation

See Also:
Constant Field Values
Method Detail

authorize

public void authorize(int operation)
               throws StandardException
Verify the connected user is authorized to perform the requested operation.

Parameters:
operation - the enumeration code for the requsted operation.
Throws:
StandardException - Thrown if the operation is not allowed

getAuthorizationId

public java.lang.String getAuthorizationId()
Get the Authorization ID for this Authorizer.


isReadOnlyConnection

public boolean isReadOnlyConnection()
Get the readOnly status for this authorizer's connection.


setReadOnlyConnection

public void setReadOnlyConnection(boolean on,
                                  boolean authorize)
                           throws StandardException
Set the readOnly status for this authorizer's connection.

Parameters:
on - true means set the connection to read only mode, false means set the connection to read wrte mode.
authorize - true means to verify the caller has authority to set the connection and false means do not check.
Throws:
StandardException - Oops not allowed.

refresh

public void refresh()
             throws StandardException
Refresh this authorizer to reflect a change in the database permissions.

Throws:
AuthorizerSessionException - Connect permission gone.
StandardException - Oops.

Built on Tue 2006-10-10 19:23:47+0200, from revision exported

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.