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

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


     * @exception StandardException
     */
    public RoutinePermsDescriptor getRoutinePermissions( UUID routineUUID, String authorizationId)
        throws StandardException
    {
        RoutinePermsDescriptor key = new RoutinePermsDescriptor( this, authorizationId, (String) null, routineUUID);

        return (RoutinePermsDescriptor) getPermissions( key);
    } // end of getRoutinePermissions
View Full Code Here


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

  void createRoutinePermPublicDescriptor(
  UUID routineUUID,
  TransactionController tc,
  String authorizationID) throws StandardException
  {
    RoutinePermsDescriptor routinePermDesc =
      new RoutinePermsDescriptor(
        this,
        "PUBLIC",
        authorizationID,
        routineUUID);
View Full Code Here

     * @exception StandardException
     */
    public RoutinePermsDescriptor getRoutinePermissions( UUID routineUUID, String authorizationId)
        throws StandardException
    {
        RoutinePermsDescriptor key = new RoutinePermsDescriptor( this, authorizationId, (String) null, routineUUID);

        return (RoutinePermsDescriptor) getPermissions( key);
    } // end of getRoutinePermissions
View Full Code Here

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

            grantee = getNullAuthorizationID();
            grantor = getNullAuthorizationID();
        }
        else
        {
            RoutinePermsDescriptor rpd = (RoutinePermsDescriptor) td;
            oid = rpd.getUUID();
            if ( oid == null )
            {
        oid = getUUIDFactory().createUUID();
        rpd.setUUID(oid);
            }
            routinePermID = oid.toString();
            grantee = getAuthorizationID( rpd.getGrantee());
            grantor = getAuthorizationID( rpd.getGrantor());
            if( rpd.getRoutineUUID() != null)
                routineID = rpd.getRoutineUUID().toString();
        }
    ExecRow row = getExecutionFactory().getValueRow( COLUMN_COUNT);
    row.setColumn( ROUTINEPERMSID_COL_NUM, new SQLChar(routinePermID));
        row.setColumn( GRANTEE_COL_NUM, grantee);
        row.setColumn( GRANTOR_COL_NUM, grantor);
View Full Code Here

        String routinePermsUUIDString = row.getColumn(ROUTINEPERMSID_COL_NUM).getString();
        UUID routinePermsUUID = getUUIDFactory().recreateUUID(routinePermsUUIDString);
        String aliasUUIDString = row.getColumn( ALIASID_COL_NUM).getString();
        UUID aliasUUID = getUUIDFactory().recreateUUID(aliasUUIDString);

        RoutinePermsDescriptor routinePermsDesc =
          new RoutinePermsDescriptor( dataDictionary,
                    getAuthorizationID( row, GRANTEE_COL_NUM),
                    getAuthorizationID( row, GRANTOR_COL_NUM),
                    aliasUUID);
        routinePermsDesc.setUUID(routinePermsUUID);
      return routinePermsDesc;
    } // end of buildDescriptor
View Full Code Here

  {
    DataDictionary dd = lcc.getDataDictionary();
    TransactionController tc = lcc.getTransactionExecute();
    ExecPreparedStatement ps = activation.getPreparedStatement();
   
    RoutinePermsDescriptor perms = dd.getRoutinePermissions( routineUUID, authorizationId);
    if( perms == null || ! perms.getHasExecutePermission())
      perms = dd.getRoutinePermissions(routineUUID, Authorizer.PUBLIC_AUTHORIZATION_ID);

    if (perms != null && perms.getHasExecutePermission()) {
      // The user or PUBLIC has execute permission, all is well.
      return;
    }

    boolean resolved = false;

    // Since no permission exists for the current user or PUBLIC,
    // check if a permission exists for the current role (if set).
    String role = lcc.getCurrentRoleId(activation);

    if (role != null) {

      // Check that role is still granted to current user or
      // to PUBLIC: A revoked role which is current for this
      // session, is lazily set to none when it is attemped
      // used.
      String dbo = dd.getAuthorizationDatabaseOwner();
      RoleGrantDescriptor rd = dd.getRoleGrantDescriptor
        (role, authorizationId, dbo);

      if (rd == null) {
        rd = dd.getRoleGrantDescriptor(
          role,
          Authorizer.PUBLIC_AUTHORIZATION_ID,
          dbo);
      }

      if (rd == null) {
        // We have lost the right to set this role, so we can't
        // make use of any permission granted to it or its
        // ancestors.
        lcc.setCurrentRole(activation, null);
      } else {
        // The current role is OK, so we can make use of
        // any permission granted to it.
        //
        // Look at the current role and, if necessary, the
        // transitive closure of roles granted to current role to
        // see if permission has been granted to any of the
        // applicable roles.

        RoleClosureIterator rci =
          dd.createRoleClosureIterator
          (activation.getTransactionController(),
           role, true /* inverse relation*/);

        String r;
        while (!resolved && (r = rci.next()) != null) {
          perms = dd.
            getRoutinePermissions(routineUUID, r);

          if (perms != null &&
              perms.getHasExecutePermission()) {
            resolved = true;
          }
        }
      }

View Full Code Here

  void createRoutinePermPublicDescriptor(
  UUID routineUUID,
  TransactionController tc,
  String authorizationID) throws StandardException
  {
    RoutinePermsDescriptor routinePermDesc =
      new RoutinePermsDescriptor(
        this,
        "PUBLIC",
        authorizationID,
        routineUUID);
View Full Code Here

     * @exception StandardException
     */
    public RoutinePermsDescriptor getRoutinePermissions( UUID routineUUID, String authorizationId)
        throws StandardException
    {
        RoutinePermsDescriptor key = new RoutinePermsDescriptor( this, authorizationId, (String) null, routineUUID);

        return (RoutinePermsDescriptor) getPermissions( key);
    } // end of getRoutinePermissions
View Full Code Here

TOP

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

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.