Package com.cloud.bridge.service.exception

Examples of com.cloud.bridge.service.exception.PermissionDeniedException


        S3PolicyContext context = new S3PolicyContext( PolicyActions.PutObject, destinationBucketName );
        context.setKeyName( destinationKeyName );
        context.setEvalParam( ConditionKeys.MetaData, request.getDirective().toString());
        context.setEvalParam( ConditionKeys.CopySource, "/" + request.getSourceBucketName() + "/" + request.getSourceKey());
        if (PolicyAccess.DENY == verifyPolicy( context ))
            throw new PermissionDeniedException( "Access Denied - bucket policy DENY result" );

        S3GetObjectResponse originalObject = handleRequest(getRequest);  
        int resultCode = originalObject.getResultCode();
        if (200 != resultCode) {
            response.setResultCode( resultCode );
View Full Code Here


        verifyBucketName( bucketName, false );

        S3PolicyContext context = new S3PolicyContext( PolicyActions.CreateBucket,  bucketName );
        context.setEvalParam( ConditionKeys.Acl, cannedAccessPolicy );
        if (PolicyAccess.DENY == verifyPolicy( context ))
            throw new PermissionDeniedException( "Access Denied - bucket policy DENY result" );
        OrderedPair<SHostVO, String> shost_storagelocation_pair = null;
        boolean success = false;
        try {
            txn = Transaction.open(Transaction.AWSAPI_DB);
View Full Code Here

                // The bucket policy can give users permission to delete a
                // bucket whereas ACLs cannot
                break;

            case DENY:
                throw new PermissionDeniedException(
                        "Access Denied - bucket policy DENY result");

            case DEFAULT_DENY:
            default:
                // Irrespective of what the ACLs say, only the owner can delete
                // a bucket
                String client = UserContext.current().getCanonicalUserId();
                if (!client.equals(sbucket.getOwnerCanonicalId())) {
                    throw new PermissionDeniedException(
                            "Access Denied - only the owner can delete a bucket");
                }
                break;
            }
View Full Code Here

        switch( verifyPolicy( context ) ) {
        case ALLOW:   // overrides ACLs (?)
            return;

        case DENY:
            throw new PermissionDeniedException( "Access Denied - bucket policy DENY result" );

        case DEFAULT_DENY:
        default:
            accessAllowed( target, targetId, requestedPermission );
            break;
View Full Code Here

            if (hasPermission( s_saclDao.listGrants( target, targetId, userId ), requestedPermission )) return;
            // Or alternatively is there is any principal authenticated ACL set for this <target, targetId>?
            if (hasPermission( s_saclDao.listGrants( target, targetId, "*" ), requestedPermission )) return;
        }
        // No privileges implies that no access is allowed  in the case of an anonymous user
        throw new PermissionDeniedException( "Access Denied - ACLs do not give user the required permission" );
    }
View Full Code Here

  }
 
  public void verify() throws PermissionDeniedException
  {
    if (0 == conditionList.size())
            throw new PermissionDeniedException( "S3 Bucket Policy Condition Block needs at least one condition" );
  }
View Full Code Here

  }
 
  public void verify() throws PermissionDeniedException
  {
    if (0 == keys.size())
            throw new PermissionDeniedException( "S3 Bucket Policy IpAddress Condition needs at least one key-value pairs" );
  }
View Full Code Here

  }
 
  public void verify() throws PermissionDeniedException
  {
    if (0 == keys.size())
            throw new PermissionDeniedException( "S3 Bucket Policy Numeric Condition needs at least one key-value pairs" );
  }
View Full Code Here

            errors++;
            value.append(" missing Resource");
        }

        if (0 < errors)
            throw new PermissionDeniedException(value.toString());
    }
View Full Code Here

    }

    public void verify() throws PermissionDeniedException {
        if (0 == keys.size())
            throw new PermissionDeniedException("S3 Bucket Policy Bool Condition needs at least one key-value pairs");
    }
View Full Code Here

TOP

Related Classes of com.cloud.bridge.service.exception.PermissionDeniedException

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.