Class StatementTablePermission
java.lang.Object
org.apache.derby.iapi.sql.dictionary.StatementPermission
org.apache.derby.iapi.sql.dictionary.StatementTablePermission
- Direct Known Subclasses:
StatementColumnPermission
This class describes a table permission required by a statement.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionStatementTablePermission(UUID tableUUID, int privType) Constructor for StatementTablePermission. -
Method Summary
Modifier and TypeMethodDescriptionvoidcheck(LanguageConnectionContext lcc, boolean forGrant, Activation activation) booleanRoutine to check if another instance of access descriptor matches this.getPermissionDescriptor(String authid, DataDictionary dd) Get the PermissionsDescriptor for the passed authorization id for this object.Return privilege needed for this access as stringintReturn privilege access requested for this access descriptorprotected TableDescriptorReturn table UUID for this access descriptorinthashCode()Return hash code for this instanceprotected booleanhasPermissionOnTable(LanguageConnectionContext lcc, Activation activation, boolean forGrant, ExecPreparedStatement ps) Check if current session has permission on the table (current user, PUBLIC or role) and, if applicable, register a dependency of ps on the current role.protected booleanoneAuthHasPermissionOnTable(DataDictionary dd, String authorizationId, boolean forGrant) toString()Methods inherited from class StatementPermission
genericCheck, getObjectType, getPrivilegedObject, isCorrectPermission
-
Field Details
-
tableUUID
UUID tableUUID -
privType
int privType
-
-
Constructor Details
-
StatementTablePermission
Constructor for StatementTablePermission. Creates an instance of table permission requested for the given access.- Parameters:
tableUUID- UUID of the tableprivType- Access privilege requested
-
-
Method Details
-
getPrivType
public int getPrivType()Return privilege access requested for this access descriptor- Returns:
- Privilege access
-
getTableUUID
-
equals
Routine to check if another instance of access descriptor matches this. Used to ensure only one access descriptor for a table of given privilege is created. Otherwise, every column reference from a table may create a descriptor for that table. -
hashCode
-
check
public void check(LanguageConnectionContext lcc, boolean forGrant, Activation activation) throws StandardException - Specified by:
checkin classStatementPermission- Parameters:
lcc- LanguageConnectionContextforGrant-activation- activation for statement needing check- Throws:
StandardException- if the permission has not been granted- See Also:
-
getTableDescriptor
- Throws:
StandardException
-
hasPermissionOnTable
protected boolean hasPermissionOnTable(LanguageConnectionContext lcc, Activation activation, boolean forGrant, ExecPreparedStatement ps) throws StandardException Check if current session has permission on the table (current user, PUBLIC or role) and, if applicable, register a dependency of ps on the current role.- Parameters:
lcc- the current language connection contextactivation- the activation of psforGrant- true if FOR GRANT is requiredps- the prepared statement for which we are checking necessary privileges- Throws:
StandardException
-
oneAuthHasPermissionOnTable
protected boolean oneAuthHasPermissionOnTable(DataDictionary dd, String authorizationId, boolean forGrant) throws StandardException - Throws:
StandardException
-
getPermissionDescriptor
public PermissionsDescriptor getPermissionDescriptor(String authid, DataDictionary dd) throws StandardException Description copied from class:StatementPermissionGet the PermissionsDescriptor for the passed authorization id for this object. This method gets called during the execution phase of create view/constraint/trigger. The return value of this method is saved in dependency system to keep track of views/constraints/triggers dependencies on required permissions. This happens in execution phase after it has been established that passed authorization id has all the permissions it needs to create that view/constraint/trigger. Which means that we can only get to writing into dependency system once all the required privileges are confirmed.- Specified by:
getPermissionDescriptorin classStatementPermission- Parameters:
authid- AuthorizationIddd- DataDictionary- Returns:
- PermissionsDescriptor The PermissionsDescriptor for the passed authorization id on this object
- Throws:
StandardException- See Also:
-
getPrivName
Return privilege needed for this access as string- Returns:
- privilege string
-
toString
-