/** * Sets the list of actions to which this policy statement applies and * returns this updated Statement object so that additional method calls can * be chained together. * <p> * Actions limit a policy statement to specific service operations that are * being allowed or denied by the policy statement. For example, you might * want to allow any AWS user to post messages to your SQS queue using the * SendMessage action, but you don't want to allow those users other actions * such as ReceiveMessage or DeleteQueue. * * @param actions * The list of actions to which this statement applies. * * @return The updated Statement object so that additional method calls can * be chained together. */ public Statement withActions(Action... actions) { setActions(Arrays.asList(actions)); return this; }
statement.setActions(actionsOf(actionNodes));
/** * Sets the list of actions to which this policy statement applies and * returns this updated Statement object so that additional method calls can * be chained together. * <p> * Actions limit a policy statement to specific service operations that are * being allowed or denied by the policy statement. For example, you might * want to allow any AWS user to post messages to your SQS queue using the * SendMessage action, but you don't want to allow those users other actions * such as ReceiveMessage or DeleteQueue. * * @param actions The list of actions to which this statement applies. * @return The updated Statement object so that additional method calls can * be chained together. */ @SuppressWarnings("checkstyle:hiddenfield") public Statement withActions(Action... actions) { setActions(Arrays.asList(actions)); return this; }
/** * Sets the list of actions to which this policy statement applies and * returns this updated Statement object so that additional method calls can * be chained together. * <p> * Actions limit a policy statement to specific service operations that are * being allowed or denied by the policy statement. For example, you might * want to allow any AWS user to post messages to your SQS queue using the * SendMessage action, but you don't want to allow those users other actions * such as ReceiveMessage or DeleteQueue. * * @param actions * The list of actions to which this statement applies. * * @return The updated Statement object so that additional method calls can * be chained together. */ public Statement withActions(Action... actions) { setActions(Arrays.asList(actions)); return this; }
statement.setActions(actionsOf(actionNodes));
statement.setId(reader.nextString()); } else if (JsonDocumentFields.ACTION.equals(name)) { statement.setActions(actionsOf(reader)); } else if (JsonDocumentFields.RESOURCE.equals(name)) { statement.setResources(resourcesOf(reader));
/** * Sets the list of actions to which this policy statement applies and * returns this updated Statement object so that additional method calls can * be chained together. * <p> * Actions limit a policy statement to specific service operations that are * being allowed or denied by the policy statement. For example, you might * want to allow any AWS user to post messages to your SQS queue using the * SendMessage action, but you don't want to allow those users other actions * such as ReceiveMessage or DeleteQueue. * * @param actions The list of actions to which this statement applies. * @return The updated Statement object so that additional method calls can * be chained together. */ @SuppressWarnings("checkstyle:hiddenfield") public Statement withActions(Action... actions) { setActions(Arrays.asList(actions)); return this; }
/** * Sets the list of actions to which this policy statement applies and * returns this updated Statement object so that additional method calls can * be chained together. * <p> * Actions limit a policy statement to specific service operations that are * being allowed or denied by the policy statement. For example, you might * want to allow any AWS user to post messages to your SQS queue using the * SendMessage action, but you don't want to allow those users other actions * such as ReceiveMessage or DeleteQueue. * * @param actions The list of actions to which this statement applies. * @return The updated Statement object so that additional method calls can * be chained together. */ @SuppressWarnings("checkstyle:hiddenfield") public Statement withActions(Action... actions) { setActions(Arrays.asList(actions)); return this; }
/** * Sets the list of actions to which this policy statement applies and * returns this updated Statement object so that additional method calls can * be chained together. * <p> * Actions limit a policy statement to specific service operations that are * being allowed or denied by the policy statement. For example, you might * want to allow any AWS user to post messages to your SQS queue using the * SendMessage action, but you don't want to allow those users other actions * such as ReceiveMessage or DeleteQueue. * * @param actions * The list of actions to which this statement applies. * * @return The updated Statement object so that additional method calls can * be chained together. */ public Statement withActions(Action... actions) { setActions(Arrays.asList(actions)); return this; }
/** * Adds a permission to allow the specified actions to the given KMS key id. * * @param kmsKeyId Full ARN to the kms key * @param actions List of actions * * @return This builder */ @SuppressWarnings("PMD.CloseResource") public AwsPolicyBuilder withKms(String kmsKeyId, KmsActions... actions) { Statement statement = new Statement(Effect.Allow); statement.setActions(Arrays.asList(actions)); statement.setResources(Arrays.asList(new Resource(kmsKeyId))); policy.getStatements().add(statement); return this; }
/** * Adds a permission to allow the specified actions to the given KMS key id. * * @param kmsKeyId Full ARN to the kms key * @param actions List of actions * * @return This builder */ @SuppressWarnings("PMD.CloseResource") public AwsPolicyBuilder withKms(String kmsKeyId, KmsActions... actions) { Statement statement = new Statement(Effect.Allow); statement.setActions(Arrays.asList(actions)); statement.setResources(Arrays.asList(new Resource(kmsKeyId))); policy.getStatements().add(statement); return this; }
/** * Adds a permission to allow the specified actions to the given bucket and s3 object key. The permission will allow the given actions only to the specified * object key. If object key is null, the permission is applied to the bucket itself. * * @param bucketName S3 bucket name * @param objectKey S3 object key * @param actions List of actions to allow * * @return This builder */ @SuppressWarnings("PMD.CloseResource") public AwsPolicyBuilder withS3(String bucketName, String objectKey, S3Actions... actions) { Statement statement = new Statement(Effect.Allow); statement.setActions(Arrays.asList(actions)); String resource = "arn:aws:s3:::" + bucketName; if (objectKey != null) { resource += "/" + objectKey; } statement.setResources(Arrays.asList(new Resource(resource))); policy.getStatements().add(statement); return this; }
/** * Adds a permission to allow the specified actions to the given bucket and s3 object key. The permission will allow the given actions only to the specified * object key. If object key is null, the permission is applied to the bucket itself. * * @param bucketName S3 bucket name * @param objectKey S3 object key * @param actions List of actions to allow * * @return This builder */ @SuppressWarnings("PMD.CloseResource") public AwsPolicyBuilder withS3(String bucketName, String objectKey, S3Actions... actions) { Statement statement = new Statement(Effect.Allow); statement.setActions(Arrays.asList(actions)); String resource = "arn:aws:s3:::" + bucketName; if (objectKey != null) { resource += "/" + objectKey; } statement.setResources(Arrays.asList(new Resource(resource))); policy.getStatements().add(statement); return this; }
statement.setActions(actionsOf(actionNodes));
statement.setId(reader.nextString()); } else if (JsonDocumentFields.ACTION.equals(name)) { statement.setActions(actionsOf(reader)); } else if (JsonDocumentFields.RESOURCE.equals(name)) { statement.setResources(resourcesOf(reader));
statement.setId(reader.nextString()); } else if (JsonDocumentFields.ACTION.equals(name)) { statement.setActions(actionsOf(reader)); } else if (JsonDocumentFields.RESOURCE.equals(name)) { statement.setResources(resourcesOf(reader));