Top Description Fields Methods
org.apache.derby.iapi.sql.conn

public Interface Authorizer

Known Direct Implementers
org.apache.derby.impl.sql.conn.GenericAuthorizer
Imports
java.util.List, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.sql.dictionary.StatementPermission, org.apache.derby.shared.common.error.StandardException

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

Modifier and TypeField and Description
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
JAR_WRITE_OP

database jar write operation

public static final int
public static final int
public static final int
public static final int
public static final int
PROPERTY_WRITE_OP

database property write operation

public static final String
PUBLIC_AUTHORIZATION_ID

The public authorization ID is defined by the SQL2003 spec as implying all users.

public static final int
public static final int
public static final int
SQL_ARBITARY_OP

Any other SQL operation

public static final int
SQL_CALL_OP

SQL CALL/VALUE operation

public static final int
SQL_DDL_OP

SQL DDL operation

public static final int
SQL_SELECT_OP

SQL SELECT operation

public static final int
SQL_WRITE_OP

SQL write (insert,update,delete) operation

public static final String
SYSTEM_AUTHORIZATION_ID

The system authorization ID is defined by the SQL2003 spec as the grantor of privileges to object owners.

public static final int
public static final int
public static final int

Method Summary

Modifier and TypeMethod and Description
public void
authorize(int
the enumeration code for the requsted operation.
operation
)

Verify the connected user is authorized to perform the requested operation.

public void
authorize(Activation
holds the list of tables, columns, and routines used.
activation
,
int
the enumeration code for the requsted operation.
operation
)

Verify the connected user is authorized to perform the requested operation.

public void
authorize(List<StatementPermission>
the required permissions
requiredPermissionsList
,
Activation
holds the execution logic
activation
)

Verify the connected user possesses the indicated permissions

public boolean
isReadOnlyConnection()

Get the readOnly status for this authorizer's connection.

public void
refresh()

Refresh this authorizer to reflect a change in the database permissions.

public void
setReadOnlyConnection(boolean
true means set the connection to read only mode, false means set the connection to read wrte mode.
on
,
boolean
true means to verify the caller has authority to set the connection and false means do not check.
authorize
)

Set the readOnly status for this authorizer's connection.

Field Detail

CREATE_ROLE_PRIVback to summary
public static final int CREATE_ROLE_PRIV
CREATE_SCHEMA_PRIVback to summary
public static final int CREATE_SCHEMA_PRIV
DELETE_PRIVback to summary
public static final int DELETE_PRIV
DROP_ROLE_PRIVback to summary
public static final int DROP_ROLE_PRIV
DROP_SCHEMA_PRIVback to summary
public static final int DROP_SCHEMA_PRIV
EXECUTE_PRIVback to summary
public static final int EXECUTE_PRIV
INSERT_PRIVback to summary
public static final int INSERT_PRIV
JAR_WRITE_OPback to summary
public static final int JAR_WRITE_OP

database jar write operation

MIN_SELECT_PRIVback to summary
public static final int MIN_SELECT_PRIV
MODIFY_SCHEMA_PRIVback to summary
public static final int MODIFY_SCHEMA_PRIV
NULL_PRIVback to summary
public static final int NULL_PRIV
PRIV_TYPE_COUNTback to summary
public static final int PRIV_TYPE_COUNT
PROPERTY_WRITE_OPback to summary
public static final int PROPERTY_WRITE_OP

database property write operation

PUBLIC_AUTHORIZATION_IDback to summary
public static final String PUBLIC_AUTHORIZATION_ID

The public authorization ID is defined by the SQL2003 spec as implying all users.

REFERENCES_PRIVback to summary
public static final int REFERENCES_PRIV
SELECT_PRIVback to summary
public static final int SELECT_PRIV
SQL_ARBITARY_OPback to summary
public static final int SQL_ARBITARY_OP

Any other SQL operation

SQL_CALL_OPback to summary
public static final int SQL_CALL_OP

SQL CALL/VALUE operation

SQL_DDL_OPback to summary
public static final int SQL_DDL_OP

SQL DDL operation

SQL_SELECT_OPback to summary
public static final int SQL_SELECT_OP

SQL SELECT operation

SQL_WRITE_OPback to summary
public static final int SQL_WRITE_OP

SQL write (insert,update,delete) operation

SYSTEM_AUTHORIZATION_IDback to summary
public static final String SYSTEM_AUTHORIZATION_ID

The system authorization ID is defined by the SQL2003 spec as the grantor of privileges to object owners.

TRIGGER_PRIVback to summary
public static final int TRIGGER_PRIV
UPDATE_PRIVback to summary
public static final int UPDATE_PRIV
USAGE_PRIVback to summary
public static final int USAGE_PRIV

Method Detail

authorizeback to summary
public void authorize(int operation) throws StandardException

Verify the connected user is authorized to perform the requested operation. This variation should only be used with operations that do not use tables or routines. If the operation involves tables or routines then use the variation of the authorize method that takes an Activation parameter. The activation holds the table, column, and routine lists.

Parameters
operation:int

the enumeration code for the requsted operation.

Exceptions
StandardException:
Thrown if the operation is not allowed
authorizeback to summary
public void authorize(Activation activation, int operation) throws StandardException

Verify the connected user is authorized to perform the requested operation.

Parameters
activation:Activation

holds the list of tables, columns, and routines used.

operation:int

the enumeration code for the requsted operation.

Exceptions
StandardException:
Thrown if the operation is not allowed
authorizeback to summary
public void authorize(List<StatementPermission> requiredPermissionsList, Activation activation) throws StandardException

Verify the connected user possesses the indicated permissions

Parameters
requiredPermissionsList:List<StatementPermission>

the required permissions

activation:Activation

holds the execution logic

Exceptions
StandardException:
Thrown if the operation is not allowed
isReadOnlyConnectionback to summary
public boolean isReadOnlyConnection()

Get the readOnly status for this authorizer's connection.

refreshback to summary
public void refresh() throws StandardException

Refresh this authorizer to reflect a change in the database permissions.

Exceptions
StandardException:
Oops.
setReadOnlyConnectionback to summary
public void setReadOnlyConnection(boolean on, boolean authorize) throws StandardException

Set the readOnly status for this authorizer's connection.

Parameters
on:boolean

true means set the connection to read only mode, false means set the connection to read wrte mode.

authorize:boolean

true means to verify the caller has authority to set the connection and false means do not check.

Exceptions
StandardException:
Oops not allowed.