/** * Indicates whether the effected permissions of this node revoke all of the specified permissions. * * @param possiblyRevokedPermissions the permissions the be evaluated against the effected revoked permissions of * this node. * @return {@code true} if the effected revoked permissions of this node contain all of * {@code possiblyRevokedPermissions}, {@code false} else. * @throws NullPointerException if {@code possiblyRevokedPermissions} is {@code null}. */ public boolean areAllRevoked(@Nonnull final Collection<String> possiblyRevokedPermissions) { checkPermissionsToBeEvaluated(possiblyRevokedPermissions); final Permissions actuallyRevokedPermissions = permissions.getRevokedPermissions(); return actuallyRevokedPermissions.containsAll(possiblyRevokedPermissions); }
/** * Indicates whether the effected permissions of this node grant all of the specified permissions and do revoke * none of them. * * @param possiblyGrantedPermissions the permissions to be evaluated against the effected permissions of this node. * @return {@code true} if the effected granted permissions of this node contain all of * {@code possiblyGrantedPermissions} and none of {@code possiblyGrantedPermissions} is revoked, {@code false} else. * @throws NullPointerException if {@code possiblyGrantedPermissions} is {@code null}. */ public boolean areAllGranted(@Nonnull final Collection<String> possiblyGrantedPermissions) { checkPermissionsToBeEvaluated(possiblyGrantedPermissions); final Permissions actuallyGrantedPermissions = permissions.getGrantedPermissions(); final Permissions actuallyRevokedPermissions = permissions.getRevokedPermissions(); final boolean areAllGranted = actuallyGrantedPermissions.containsAll(possiblyGrantedPermissions); final boolean isNoneRevoked = Collections.disjoint(actuallyRevokedPermissions, possiblyGrantedPermissions); return areAllGranted && isNoneRevoked; }