Package com.cloud.bridge.service.core.s3.S3PolicyAction

Examples of com.cloud.bridge.service.core.s3.S3PolicyAction.PolicyActions


        //
        SBucketVO sbucket = bucketDao.getByName(bucketName);
        if (sbucket == null)
            throw new NoSuchObjectException("Bucket " + bucketName + " does not exist");

        PolicyActions action = (includeVersions ? PolicyActions.ListBucketVersions : PolicyActions.ListBucket);
        S3PolicyContext context = new S3PolicyContext(action, bucketName);
        context.setEvalParam(ConditionKeys.MaxKeys, new String("" + maxKeys));
        context.setEvalParam(ConditionKeys.Prefix, prefix);
        context.setEvalParam(ConditionKeys.Delimiter, delimiter);
        verifyAccess(context, "SBucket", sbucket.getId(), SAcl.PERMISSION_READ);
View Full Code Here


   
    SBucketDao bucketDao = new SBucketDao();
    SBucket sbucket = bucketDao.getByName(bucketName);
    if (sbucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist");
   
    PolicyActions action = (includeVersions ? PolicyActions.ListBucketVersions : PolicyActions.ListBucket);
    S3PolicyContext context = new S3PolicyContext( action, bucketName );
    context.setEvalParam( ConditionKeys.MaxKeys, new String( "" + maxKeys ));
    context.setEvalParam( ConditionKeys.Prefix, prefix );
    context.setEvalParam( ConditionKeys.Delimiter, delimiter );
    verifyAccess( context, "SBucket", sbucket.getId(), SAcl.PERMISSION_READ );
View Full Code Here

   
   
    // [B] Is the operationRequested included in the policy statement?
    //  -> if the value in "NotAction:" matches that requested then the statement does not apply
    //  (i.e., "refers to all actions other" than defined).
    PolicyActions notActions = oneStatement.getNotAction();
      //System.out.println( "Statement: NotAction:" + notActions + " op requested: " + operationRequested );

      if ( PolicyActions.UnknownAction != notActions ) {
         if (notActions == operationRequested) return false;
      }
View Full Code Here

   
    //
    SBucketVO sbucket = bucketDao.getByName(bucketName);
    if (sbucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist");

    PolicyActions action = (includeVersions ? PolicyActions.ListBucketVersions : PolicyActions.ListBucket);
    S3PolicyContext context = new S3PolicyContext( action, bucketName );
    context.setEvalParam( ConditionKeys.MaxKeys, new String( "" + maxKeys ));
    context.setEvalParam( ConditionKeys.Prefix, prefix );
    context.setEvalParam( ConditionKeys.Delimiter, delimiter );
    verifyAccess( context, "SBucket", sbucket.getId(), SAcl.PERMISSION_READ );
View Full Code Here

        //
        SBucketVO sbucket = bucketDao.getByName(bucketName);
        if (sbucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist");

        PolicyActions action = (includeVersions ? PolicyActions.ListBucketVersions : PolicyActions.ListBucket);
        S3PolicyContext context = new S3PolicyContext( action, bucketName );
        context.setEvalParam( ConditionKeys.MaxKeys, new String( "" + maxKeys ));
        context.setEvalParam( ConditionKeys.Prefix, prefix );
        context.setEvalParam( ConditionKeys.Delimiter, delimiter );
        verifyAccess( context, "SBucket", sbucket.getId(), SAcl.PERMISSION_READ );
View Full Code Here

        //
        SBucketVO sbucket = bucketDao.getByName(bucketName);
        if (sbucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist");

        PolicyActions action = (includeVersions ? PolicyActions.ListBucketVersions : PolicyActions.ListBucket);
        S3PolicyContext context = new S3PolicyContext( action, bucketName );
        context.setEvalParam( ConditionKeys.MaxKeys, new String( "" + maxKeys ));
        context.setEvalParam( ConditionKeys.Prefix, prefix );
        context.setEvalParam( ConditionKeys.Delimiter, delimiter );
        verifyAccess( context, "SBucket", sbucket.getId(), SAcl.PERMISSION_READ );
View Full Code Here


        // [B] "The bucket owner by default has permissions to attach bucket policies to their buckets using PUT Bucket policy."
        //  -> the bucket owner may want to restrict the IP address from where this can be executed
        String client = UserContext.current().getCanonicalUserId();
        S3PolicyContext context = new S3PolicyContext(
                PolicyActions.PutBucketPolicy, bucketName);

        switch (S3Engine.verifyPolicy(context)) {
        case ALLOW:
            break;
View Full Code Here

        // [B]
        // "The bucket owner by default has permissions to retrieve bucket policies using GET Bucket policy."
        // -> the bucket owner may want to restrict the IP address from where
        // this can be executed
        String client = UserContext.current().getCanonicalUserId();
        S3PolicyContext context = new S3PolicyContext(
                PolicyActions.GetBucketPolicy, bucketName);
        switch (S3Engine.verifyPolicy(context)) {
        case ALLOW:
            break;
View Full Code Here

        // [B] The owner may want to restrict the IP address at which this can be performed
        String client = UserContext.current().getCanonicalUserId();
        if (!client.equals( sbucket.getOwnerCanonicalId()))
            throw new PermissionDeniedException( "Access Denied - only the owner can read bucket versioning" );

        S3PolicyContext context = new S3PolicyContext( PolicyActions.GetBucketVersioning, bucketName );
        if (PolicyAccess.DENY == S3Engine.verifyPolicy( context )) {
            response.setStatus(403);
            return;
        }
View Full Code Here

            String client = UserContext.current().getCanonicalUserId();
            if (!client.equals(sbucket.getOwnerCanonicalId()))
                throw new PermissionDeniedException(
                        "Access Denied - only the owner can turn on versioing on a bucket");

            S3PolicyContext context = new S3PolicyContext(
                    PolicyActions.PutBucketVersioning, bucketName);
            if (PolicyAccess.DENY == S3Engine.verifyPolicy(context)) {
                response.setStatus(403);
                return;
            }
View Full Code Here

TOP

Related Classes of com.cloud.bridge.service.core.s3.S3PolicyAction.PolicyActions

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.