Package com.cloud.bridge.service.exception

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


        return true;
    }

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


        return true;
    }

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

        return true;
    }

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

        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 = TransactionLegacy.open(TransactionLegacy.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;
            }

            // Delete the file from its storage location
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

            // 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

        } catch (PermissionDeniedException e) {
            logger.error("Put Bucket Policy failed due to " + e.getMessage(), e);
            throw e;
        } catch (ParseException e) {
            logger.error("Put Bucket Policy failed due to " + e.getMessage(), e);
            throw new PermissionDeniedException(e.toString());
        } catch (Exception e) {
            logger.error("Put Bucket Policy failed due to " + e.getMessage(), e);
            response.setStatus(500);
        }
    }
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

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.