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

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


                                  "Invalid SYSTABLEPERMS.referencesPriv column value: " + referencesPriv);
            SanityManager.ASSERT( "y".equals(triggerPriv) || "Y".equals(triggerPriv) || "N".equals(triggerPriv),
                                  "Invalid SYSTABLEPERMS.triggerPriv column value: " + triggerPriv);
        }

    TablePermsDescriptor tabPermsDesc =
        new TablePermsDescriptor( dataDictionary,
                                         getAuthorizationID( row, GRANTEE_COL_NUM),
                                         getAuthorizationID( row, GRANTOR_COL_NUM),
                                         tableUUID,
                                         selectPriv, deletePriv, insertPriv,
                                         updatePriv, referencesPriv, triggerPriv);
    tabPermsDesc.setUUID(tablePermsUUID);
    return tabPermsDesc;
    } // end of buildDescriptor
View Full Code Here


     * @exception StandardException standard error policy
     */
    public int orPermissions( ExecRow row, PermissionsDescriptor perm, boolean[] colsChanged)
        throws StandardException
    {
        TablePermsDescriptor tablePerms = (TablePermsDescriptor) perm;
        int changeCount = 0;
        changeCount += orOnePermission( row, colsChanged, SELECTPRIV_COL_NUM, tablePerms.getSelectPriv());
        changeCount += orOnePermission( row, colsChanged, DELETEPRIV_COL_NUM, tablePerms.getDeletePriv());
        changeCount += orOnePermission( row, colsChanged, INSERTPRIV_COL_NUM, tablePerms.getInsertPriv());
        changeCount += orOnePermission( row, colsChanged, UPDATEPRIV_COL_NUM, tablePerms.getUpdatePriv());
        changeCount += orOnePermission( row, colsChanged, REFERENCESPRIV_COL_NUM, tablePerms.getReferencesPriv());
        changeCount += orOnePermission( row, colsChanged, TRIGGERPRIV_COL_NUM, tablePerms.getTriggerPriv());

        return changeCount;
    } // end of orPermissions
View Full Code Here

     * @exception StandardException standard error policy
     */
    public int removePermissions( ExecRow row, PermissionsDescriptor perm, boolean[] colsChanged)
        throws StandardException
    {
        TablePermsDescriptor tablePerms = (TablePermsDescriptor) perm;
        int changeCount = 0;
        boolean permissionsLeft =
          ( removeOnePermission( row, colsChanged, SELECTPRIV_COL_NUM, tablePerms.getSelectPriv()) |
            removeOnePermission( row, colsChanged, DELETEPRIV_COL_NUM, tablePerms.getDeletePriv()) |
            removeOnePermission( row, colsChanged, INSERTPRIV_COL_NUM, tablePerms.getInsertPriv()) |
            removeOnePermission( row, colsChanged, UPDATEPRIV_COL_NUM, tablePerms.getUpdatePriv()) |
            removeOnePermission( row, colsChanged, REFERENCESPRIV_COL_NUM, tablePerms.getReferencesPriv()) |
            removeOnePermission( row, colsChanged, TRIGGERPRIV_COL_NUM, tablePerms.getTriggerPriv()));
        if( ! permissionsLeft)
            return -1;
        for( int i = 0; i < colsChanged.length; i++)
        {
            if( colsChanged[ i])
View Full Code Here

    // Check that the current user has permission to grant the privileges.
    checkOwnership( currentUser, td, sd, dd, lcc, grant);
   
    DataDescriptorGenerator ddg = dd.getDataDescriptorGenerator();

    TablePermsDescriptor tablePermsDesc =
      ddg.newTablePermsDescriptor( td,
                     getPermString( SELECT_ACTION, false),
                     getPermString( DELETE_ACTION, false),
                     getPermString( INSERT_ACTION, false),
                     getPermString( UPDATE_ACTION, false),
View Full Code Here

            grantee = getNullAuthorizationID();
            grantor = getNullAuthorizationID();
        }
        else
        {
            TablePermsDescriptor tpd = (TablePermsDescriptor) td;
            oid = tpd.getUUID();
            if ( oid == null )
            {
        oid = getUUIDFactory().createUUID();
        tpd.setUUID(oid);
            }
            tablePermID = oid.toString();

      grantee = getAuthorizationID( tpd.getGrantee());
            grantor = getAuthorizationID( tpd.getGrantor());
            tableID = tpd.getTableUUID().toString();
            selectPriv = tpd.getSelectPriv();
            deletePriv = tpd.getDeletePriv();
            insertPriv = tpd.getInsertPriv();
            updatePriv = tpd.getUpdatePriv();
            referencesPriv = tpd.getReferencesPriv();
            triggerPriv = tpd.getTriggerPriv();
        }
        ExecRow row = getExecutionFactory().getValueRow( COLUMN_COUNT);
        row.setColumn( TABLEPERMSID_COL_NUM, new SQLChar(tablePermID));
        row.setColumn( GRANTEE_COL_NUM, grantee);
        row.setColumn( GRANTOR_COL_NUM, grantor);
View Full Code Here

                                  "Invalid SYSTABLEPERMS.referencesPriv column value: " + referencesPriv);
            SanityManager.ASSERT( "y".equals(triggerPriv) || "Y".equals(triggerPriv) || "N".equals(triggerPriv),
                                  "Invalid SYSTABLEPERMS.triggerPriv column value: " + triggerPriv);
        }

    TablePermsDescriptor tabPermsDesc =
        new TablePermsDescriptor( dataDictionary,
                                         getAuthorizationID( row, GRANTEE_COL_NUM),
                                         getAuthorizationID( row, GRANTOR_COL_NUM),
                                         tableUUID,
                                         selectPriv, deletePriv, insertPriv,
                                         updatePriv, referencesPriv, triggerPriv);
    tabPermsDesc.setUUID(tablePermsUUID);
    return tabPermsDesc;
    } // end of buildDescriptor
View Full Code Here

     * @exception StandardException standard error policy
     */
    public int orPermissions( ExecRow row, PermissionsDescriptor perm, boolean[] colsChanged)
        throws StandardException
    {
        TablePermsDescriptor tablePerms = (TablePermsDescriptor) perm;
        int changeCount = 0;
        changeCount += orOnePermission( row, colsChanged, SELECTPRIV_COL_NUM, tablePerms.getSelectPriv());
        changeCount += orOnePermission( row, colsChanged, DELETEPRIV_COL_NUM, tablePerms.getDeletePriv());
        changeCount += orOnePermission( row, colsChanged, INSERTPRIV_COL_NUM, tablePerms.getInsertPriv());
        changeCount += orOnePermission( row, colsChanged, UPDATEPRIV_COL_NUM, tablePerms.getUpdatePriv());
        changeCount += orOnePermission( row, colsChanged, REFERENCESPRIV_COL_NUM, tablePerms.getReferencesPriv());
        changeCount += orOnePermission( row, colsChanged, TRIGGERPRIV_COL_NUM, tablePerms.getTriggerPriv());

        return changeCount;
    } // end of orPermissions
View Full Code Here

     * @exception StandardException standard error policy
     */
    public int removePermissions( ExecRow row, PermissionsDescriptor perm, boolean[] colsChanged)
        throws StandardException
    {
        TablePermsDescriptor tablePerms = (TablePermsDescriptor) perm;
        int changeCount = 0;
        boolean permissionsLeft =
          ( removeOnePermission( row, colsChanged, SELECTPRIV_COL_NUM, tablePerms.getSelectPriv()) |
            removeOnePermission( row, colsChanged, DELETEPRIV_COL_NUM, tablePerms.getDeletePriv()) |
            removeOnePermission( row, colsChanged, INSERTPRIV_COL_NUM, tablePerms.getInsertPriv()) |
            removeOnePermission( row, colsChanged, UPDATEPRIV_COL_NUM, tablePerms.getUpdatePriv()) |
            removeOnePermission( row, colsChanged, REFERENCESPRIV_COL_NUM, tablePerms.getReferencesPriv()) |
            removeOnePermission( row, colsChanged, TRIGGERPRIV_COL_NUM, tablePerms.getTriggerPriv()));
        if( ! permissionsLeft)
            return -1;
        for( int i = 0; i < colsChanged.length; i++)
        {
            if( colsChanged[ i])
View Full Code Here

     * @exception StandardException
     */
    public TablePermsDescriptor getTablePermissions( UUID tableUUID, String authorizationId)
        throws StandardException
    {
        TablePermsDescriptor key = new TablePermsDescriptor( this, authorizationId, (String) null, tableUUID);
        return (TablePermsDescriptor) getPermissions( key);
    } // end of getTablePermissions
View Full Code Here

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

TOP

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

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.