/** * Set the given permissions on the specified {@code resourceType} and {@code resourcePath} as "revoked" * to this builder. * * @param resourceType the type of the Resource to set the permissions on. * @param resourcePath the path of the Resource to set the permissions on. * @param revokedPermission the Permission to set as "revoke"ed on the Resource in the label. * @param furtherRevokedPermissions further Permissions to set as "revoke"ed on the Resource in the label. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped setRevokedPermissions(final String resourceType, final JsonPointer resourcePath, final String revokedPermission, final String... furtherRevokedPermissions) { setRevokedPermissionsFor(getLabel(), resourceType, resourcePath, revokedPermission, furtherRevokedPermissions); return this; }
/** * Set the given permissions on the specified {@code resourceType} and {@code resourcePath} as "revoked" to * this builder. * * @param resourceType the type of the Resource to set the permissions on. * @param resourcePath the path of the Resource to set the permissions on. * @param revokedPermissions the Permissions to set as "revoke"ed on the Resource in the label. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped setRevokedPermissions(final String resourceType, final JsonPointer resourcePath, final Permissions revokedPermissions) { setRevokedPermissionsFor(getLabel(), resourceType, resourcePath, revokedPermissions); return this; }
/** * Set the given {@link String}s on the specified {@code resourceKey} * as "granted" to this builder. * * @param resourceKey the ResourceKey to set the permissions on. * @param grantedPermission the Permission to set as "grant"ed on the Resource in the label. * @param furtherGrantedPermissions further Permissions to set as "grant"ed on the Resource in the label. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped setGrantedPermissions(final ResourceKey resourceKey, final String grantedPermission, final String... furtherGrantedPermissions) { setGrantedPermissionsFor(getLabel(), resourceKey, grantedPermission, furtherGrantedPermissions); return this; }
/** * Set the given permissions on the specified {@code resourceKey} as "revoked" to this builder. * * @param resourceKey the ResourceKey to set the permissions on. * @param revokedPermission the Permission to set as "revoke"ed on the Resource in the label. * @param furtherRevokedPermissions further Permissions to set as "revoke"ed on the Resource in the label. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped setRevokedPermissions(final ResourceKey resourceKey, final String revokedPermission, final String... furtherRevokedPermissions) { setRevokedPermissionsFor(getLabel(), resourceKey, revokedPermission, furtherRevokedPermissions); return this; }
/** * Sets the given {@link Subject} to the specified {@code label} to this builder. A previous entry with the same * {@code subjectId} in the {@link Label} is replaced by the specified one. Sets the subject type * to {@link SubjectType#GENERATED}. * * @param issuer the SubjectId's {@code issuer}. * @param subject the character sequence for the SubjectId's {@code subject}. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped setSubject(final SubjectIssuer issuer, final CharSequence subject) { setSubjectFor(getLabel(), Subject.newInstance(issuer, subject)); return this; }
/** * Sets the given {@link Subject} to the specified {@code label} to this builder. A previous entry with the same * {@code subjectId} in the {@link Label} is replaced by the specified one. * * @param issuer the SubjectId's {@code issuer}. * @param subject the character sequence for the SubjectId's {@code subject}. * @param subjectType the type of the subject to set. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped setSubject(final SubjectIssuer issuer, final CharSequence subject, final SubjectType subjectType) { setSubjectFor(getLabel(), Subject.newInstance(issuer, subject, subjectType)); return this; }
/** * Sets the given {@link Subjects} to the specified {@code label} to this builder. All previous entries with the * same * {@code subjectId} in the {@link Label} are replaced by the specified ones. * * @param subjects the Subjects to set for the PolicyEntry identified by the {@code label}. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped setSubjects(final Subjects subjects) { setSubjectsFor(getLabel(), subjects); return this; }
/** * Set the given permissions on the specified {@code resourceKey} as "revoked" to this builder. * * @param resourceKey the ResourceKey to set the permissions on. * @param revokedPermissions the Permissions to set as "revoke"ed on the resource in the label. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped setRevokedPermissions(final ResourceKey resourceKey, final Permissions revokedPermissions) { setRevokedPermissionsFor(getLabel(), resourceKey, revokedPermissions); return this; }
/** * Removes the resource identified by the specified {@code resourceKey} from this builder. * * @param resourceKey the ResourceKey to remove from the PolicyEntry identified by the {@code label}. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped removeResource(final ResourceKey resourceKey) { removeResourceFor(getLabel(), resourceKey); return this; }
/** * Sets the given {@link Resource} to the specified {@code label} to this builder. A previous entry with the * same {@code resourcePath} in the {@link Label} is replaced by the specified one. * * @param resource the Resource to set for the PolicyEntry identified by the {@code label}. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped setResource(final Resource resource) { setResourceFor(getLabel(), resource); return this; }
/** * Removes the subject identified by the specified {@code subjectIssuerWithId} from this builder. * * @param subjectIssuerWithId the Subject issuer + Subject ID (separated with a "{@value * SubjectId#ISSUER_DELIMITER}") of the Subject to remove from the PolicyEntry identified by the {@code label}. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped removeSubject(final CharSequence subjectIssuerWithId) { removeSubjectFor(getLabel(), SubjectId.newInstance(subjectIssuerWithId)); return this; }
/** * Sets the given {@link Subject} to the specified {@code label} to this builder. A previous entry with the same * {@code subjectId} in the {@link Label} is replaced by the specified one. * * @param subject the Subject to set for the PolicyEntry identified by the {@code label}. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped setSubject(final Subject subject) { setSubjectFor(getLabel(), subject); return this; }
/** * Set the given {@link Permissions} on the specified {@code resourceKey} * as "granted" to this builder. * * @param resourceKey the ResourceKey to set the permissions on. * @param grantedPermissions the Permissions to set as "grant"ed on the resource in the label. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped setGrantedPermissions(final ResourceKey resourceKey, final Permissions grantedPermissions) { setGrantedPermissionsFor(getLabel(), resourceKey, grantedPermissions); return this; }
/** * Set the given {@link EffectedPermissions} on the specified {@code resourceKey} to this builder. * * @param resourceKey the ResourceKey to set the effected permissions on. * @param effectedPermissions the EffectedPermissions to set on the resource in the label. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped setPermissions(final ResourceKey resourceKey, final EffectedPermissions effectedPermissions) { setPermissionsFor(getLabel(), resourceKey, effectedPermissions); return this; }
/** * Removes the subject identified by the specified {@code issuer} and {@code subject} from this builder. * * @param issuer the SubjectId's {@code issuer} to remove from the PolicyEntry identified by the {@code label}. * @param subject the character sequence for the SubjectId's {@code subject} to remove from the PolicyEntry * identified by the {@code label}. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped removeSubject(final SubjectIssuer issuer, final CharSequence subject) { removeSubjectFor(getLabel(), SubjectId.newInstance(issuer, subject)); return this; }
/** * Removes the specified {@code resource} from this builder. * * @param resource the Resource to remove from the PolicyEntry identified by the {@code label}. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped removeResource(final Resource resource) { removeResourceFor(getLabel(), resource); return this; }
/** * Removes the subject identified by the specified {@code subjectId} from this builder. * * @param subjectId the Subject ID to remove from the PolicyEntry identified by the {@code label}. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped removeSubject(final SubjectId subjectId) { removeSubjectFor(getLabel(), subjectId); return this; }
/** * Sets the given {@link Subject} to the specified {@code label} to this builder. A previous entry with the same * {@code subjectIssuerWithId} in the {@link Label} is replaced by the specified one. * * @param subjectIssuerWithId the Subject issuer + Subject ID (separated with a "{@value * SubjectId#ISSUER_DELIMITER}") of the Subject to set. * @param subjectType the type of the subject to set. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped setSubject(final CharSequence subjectIssuerWithId, final SubjectType subjectType) { setSubjectFor(getLabel(), Subject.newInstance(subjectIssuerWithId, subjectType)); return this; }
/** * Removes the specified {@code subject} from this builder. * * @param subject the Subject to remove from the PolicyEntry identified by the {@code label}. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped removeSubject(final Subject subject) { removeSubjectFor(getLabel(), subject); return this; }
/** * Sets the given {@link Resources} to the specified {@code label} to this builder. All previous entries with * the same {@code resourcePath} in the {@link Label} are replaced by the specified ones. * * @param resources the Resources to set for the PolicyEntry identified by the {@code label}. * @return this builder to allow method chaining. * @throws NullPointerException if any argument is {@code null}. */ default LabelScoped setResources(final Resources resources) { setResourcesFor(getLabel(), resources); return this; }