Class TablePrivilegeInfo

    • Constructor Detail

      • TablePrivilegeInfo

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

      • checkOwnership

        protected void checkOwnership​(java.lang.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​(java.lang.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,
                                       java.util.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 java.lang.String getPermString​(int action,
                                               boolean forGrantOption)
      • getActionString

        private java.lang.String getActionString​(int action,
                                                 boolean forGrantOption)
      • hasColumnPermissions

        private boolean hasColumnPermissions​(int action)