Package org.apache.derby.iapi.sql.dictionary

Examples of org.apache.derby.iapi.sql.dictionary.ColPermsDescriptor


     * @exception StandardException standard error policy
     */
    public int removePermissions( ExecRow row, PermissionsDescriptor perm, boolean[] colsChanged)
        throws StandardException
    {
        ColPermsDescriptor colPerms = (ColPermsDescriptor) perm;
        FormatableBitSet removeColSet = colPerms.getColumns();
        if( removeColSet == null)
            // remove all of them
            return -1;
       
        FormatableBitSet existingColSet = (FormatableBitSet) row.getColumn( COLUMNS_COL_NUM).getObject();
View Full Code Here


      false);

    /* Next, using each of the ColPermDescriptor's uuid, get the unique row
    in SYSCOLPERMS and adjust the "COLUMNS" column in SYSCOLPERMS to
    accomodate the added or dropped column in the tableid*/
    ColPermsDescriptor colPermsDescriptor;
    ExecRow curRow;
    ExecIndexRow uuidKey;
    // Not updating any indexes on SYSCOLPERMS
    boolean[] bArray = new boolean[SYSCOLPERMSRowFactory.TOTAL_NUM_OF_INDEXES];
    int[] colsToUpdate = {SYSCOLPERMSRowFactory.COLUMNS_COL_NUM};
View Full Code Here

  /* @see org.apache.derby.iapi.sql.dictionary.DataDictionary#getColumnPermissions */
    public ColPermsDescriptor getColumnPermissions( UUID colPermsUUID)
    throws StandardException
  {
      ColPermsDescriptor key = new ColPermsDescriptor( this, colPermsUUID);
        return getUncachedColPermsDescriptor( key );
  }
View Full Code Here

    {
        String privTypeStr = forGrant ? colPrivTypeMapForGrant[privType] : colPrivTypeMap[privType];
        if( SanityManager.DEBUG)
            SanityManager.ASSERT( privTypeStr != null,
                                  "Invalid column privilege type: " + privType);
        ColPermsDescriptor key = new ColPermsDescriptor( this,
                                                         authorizationId,
                                                         (String) null,
                                                         tableUUID,
                                                         privTypeStr);
        return (ColPermsDescriptor) getPermissions( key);
View Full Code Here

            String privTypeStr,
            boolean forGrant,
            String authorizationId)
    throws StandardException
  {
        ColPermsDescriptor key = new ColPermsDescriptor( this,
                                                         authorizationId,
                                                         (String) null,
                                                         tableUUID,
                                                         privTypeStr);
        return (ColPermsDescriptor) getPermissions( key);
View Full Code Here

            grantee = getNullAuthorizationID();
            grantor = getNullAuthorizationID();
        }
        else
        {
            ColPermsDescriptor cpd = (ColPermsDescriptor) td;
            oid = cpd.getUUID();
            if ( oid == null )
            {
              oid = getUUIDFactory().createUUID();
              cpd.setUUID(oid);          
            }
            colPermID = oid.toString();
            grantee = getAuthorizationID( cpd.getGrantee());
            grantor = getAuthorizationID( cpd.getGrantor());
            tableID = cpd.getTableUUID().toString();
            type = cpd.getType();
            columns = cpd.getColumns();
        }
        ExecRow row = getExecutionFactory().getValueRow( COLUMN_COUNT);
        row.setColumn( COLPERMSID_COL_NUM, new SQLChar(colPermID));
        row.setColumn( GRANTEE_COL_NUM, grantee);
        row.setColumn( GRANTOR_COL_NUM, grantor);
View Full Code Here

            SanityManager.ASSERT( "s".equals( type) || "S".equals( type) ||
                                  "u".equals( type) || "U".equals( type) ||
                                  "r".equals( type) || "R".equals( type),
                                  "Invalid type passed to SYSCOLPERMSRowFactory.buildDescriptor");

        ColPermsDescriptor colPermsDesc =
          new ColPermsDescriptor( dataDictionary,
                    getAuthorizationID( row, GRANTEE_COL_NUM),
                    getAuthorizationID( row, GRANTOR_COL_NUM),
                    tableUUID, type, columns);
        colPermsDesc.setUUID(colPermsUUID);
        return colPermsDesc;
    } // end of buildDescriptor
View Full Code Here

            // (grantee, tableID, type) combination. We must either handle the multiple rows, which is necessary for
            // checking permissions, or add a grantor column to the key, which is necessary for granting or revoking
            // permissions.
            row = getExecutionFactory().getIndexableRow( 3);
            row.setColumn(1, getAuthorizationID( perm.getGrantee()));
            ColPermsDescriptor colPerms = (ColPermsDescriptor) perm;
            String tableUUIDStr = colPerms.getTableUUID().toString();
            row.setColumn(2, new SQLChar(tableUUIDStr));
            row.setColumn(3, new SQLChar(colPerms.getType()));
            break;
        case COLPERMSID_INDEX_NUM:
            row = getExecutionFactory().getIndexableRow( 1);
            String colPermsUUIDStr = perm.getObjectID().toString();
            row.setColumn(1, new SQLChar(colPermsUUIDStr));
            break;
        case TABLEID_INDEX_NUM:
            row = getExecutionFactory().getIndexableRow( 1);
            colPerms = (ColPermsDescriptor) perm;
            tableUUIDStr = colPerms.getTableUUID().toString();
            row.setColumn(1, new SQLChar(tableUUIDStr));
            break;
        }
        return row;
    } // end of buildIndexKeyRow
View Full Code Here

     * @exception StandardException standard error policy
     */
    public int orPermissions( ExecRow row, PermissionsDescriptor perm, boolean[] colsChanged)
        throws StandardException
    {
        ColPermsDescriptor colPerms = (ColPermsDescriptor) perm;
        FormatableBitSet existingColSet = (FormatableBitSet) row.getColumn( COLUMNS_COL_NUM).getObject();
        FormatableBitSet newColSet = colPerms.getColumns();

        boolean changed = false;
        for( int i = newColSet.anySetBit(); i >= 0; i = newColSet.anySetBit(i))
        {
            if( ! existingColSet.get(i))
View Full Code Here

     * @exception StandardException standard error policy
     */
    public int removePermissions( ExecRow row, PermissionsDescriptor perm, boolean[] colsChanged)
        throws StandardException
    {
        ColPermsDescriptor colPerms = (ColPermsDescriptor) perm;
        FormatableBitSet removeColSet = colPerms.getColumns();
        if( removeColSet == null)
            // remove all of them
            return -1;
       
        FormatableBitSet existingColSet = (FormatableBitSet) row.getColumn( COLUMNS_COL_NUM).getObject();
View Full Code Here

TOP

Related Classes of org.apache.derby.iapi.sql.dictionary.ColPermsDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.