Class TablePrivilegeInfo

java.lang.Object
org.apache.derby.impl.sql.execute.PrivilegeInfo
org.apache.derby.impl.sql.execute.TablePrivilegeInfo

public class TablePrivilegeInfo extends PrivilegeInfo
  • Field Details

  • Constructor Details

    • TablePrivilegeInfo

      public TablePrivilegeInfo(TableDescriptor td, boolean[] actionAllowed, FormatableBitSet[] columnBitSets, List descriptorList)
      Parameters:
      actionAllowed - actionAllowed[action] is true if action is in the privilege set.
  • Method Details

    • checkOwnership

      protected void checkOwnership(String user, TableDescriptor td, SchemaDescriptor sd, DataDictionary dd, LanguageConnectionContext lcc, boolean grant) throws StandardException
      Determines whether a user is the owner of an object (table, function, or procedure). Note that the database creator can access database objects without needing to be their owner.
      Parameters:
      user - authorizationId of current user
      td - table descriptor being checked against
      sd - SchemaDescriptor
      dd - DataDictionary
      lcc - LanguageConnectionContext
      grant - grant if true; revoke if false
      Throws:
      StandardException - if user does not own the object
    • checkPrivileges

      private void checkPrivileges(String user, TableDescriptor td, SchemaDescriptor sd, DataDictionary dd, LanguageConnectionContext lcc) throws StandardException
      Determines if the privilege is grantable by this grantor for the given view. Note that the database owner can access database objects without needing to be their owner. This method should only be called if it is a GRANT.
      Parameters:
      user - authorizationId of current user
      td - TableDescriptor to be checked against
      sd - SchemaDescriptor
      dd - DataDictionary
      lcc - LanguageConnectionContext
      Throws:
      StandardException - if user does not have permission to grant
    • executeGrantRevoke

      public void executeGrantRevoke(Activation activation, boolean grant, List grantees) throws StandardException
      This is the guts of the Execution-time logic for GRANT/REVOKE of a table privilege
      Specified by:
      executeGrantRevoke in class PrivilegeInfo
      Parameters:
      activation -
      grant - true if grant, false if revoke
      grantees - a list of authorization ids (strings)
      Throws:
      StandardException - Thrown on failure
    • getPermString

      private String getPermString(int action, boolean forGrantOption)
    • getActionString

      private String getActionString(int action, boolean forGrantOption)
    • hasColumnPermissions

      private boolean hasColumnPermissions(int action)