/** * @param granteeId * @return the permissions assigned to a grantee, as identified by the given ID. */ public Collection<String> getPermissions(String granteeId) { Collection<Grant> grantsForGrantee = findGrantsForGrantee(granteeId); return Collections2.transform(grantsForGrantee, new Function<Grant, String>() { public String apply(Grant g) { return g.getPermission(); } }); }
/** * @param granteeId * @return the permissions assigned to a grantee, as identified by the given ID. */ public Collection<String> getPermissions(String granteeId) { Collection<Grant> grantsForGrantee = findGrantsForGrantee(granteeId); return Collections2.transform(grantsForGrantee, new Function<Grant, String>() { public String apply(Grant g) { return g.getPermission(); } }); }
/** * @param granteeId * @return the permissions assigned to a grantee, as identified by the given ID. */ public Collection<String> getPermissions(String granteeId) { Collection<Grant> grantsForGrantee = findGrantsForGrantee(granteeId); return Collections2.transform(grantsForGrantee, new Function<Grant, String>() { public String apply(Grant g) { return g.getPermission(); } }); }
/** * @param granteeId * @return the permissions assigned to a grantee, as identified by the given ID. */ public Collection<String> getPermissions(String granteeId) { Collection<Grant> grantsForGrantee = findGrantsForGrantee(granteeId); return Collections2.transform(grantsForGrantee, new Function<Grant, String>() { public String apply(Grant g) { return g.getPermission(); } }); }
/** * @param granteeId * @return the permissions assigned to a grantee, as identified by the given ID. */ public Collection<String> getPermissions(String granteeId) { Collection<Grant> grantsForGrantee = findGrantsForGrantee(granteeId); return Collections2.transform(grantsForGrantee, new Function<Grant, String>() { public String apply(Grant g) { return g.getPermission(); } }); }
/** * Revoke all the permissions granted to the given grantee. * * @param grantee */ public AccessControlList revokeAllPermissions(Grantee grantee) { Collection<Grant> grantsForGrantee = findGrantsForGrantee(grantee.getIdentifier()); grants.removeAll(grantsForGrantee); return this; }
/** * Revoke all the permissions granted to the given grantee. * * @param grantee */ public AccessControlList revokeAllPermissions(Grantee grantee) { Collection<Grant> grantsForGrantee = findGrantsForGrantee(grantee.getIdentifier()); grants.removeAll(grantsForGrantee); return this; }
/** * Revoke all the permissions granted to the given grantee. * * @param grantee */ public AccessControlList revokeAllPermissions(Grantee grantee) { Collection<Grant> grantsForGrantee = findGrantsForGrantee(grantee.getIdentifier()); grants.removeAll(grantsForGrantee); return this; }
/** * Revoke all the permissions granted to the given grantee. * * @param grantee */ public AccessControlList revokeAllPermissions(Grantee grantee) { Collection<Grant> grantsForGrantee = findGrantsForGrantee(grantee.getIdentifier()); grants.removeAll(grantsForGrantee); return this; }
/** * Revoke all the permissions granted to the given grantee. * * @param grantee */ public AccessControlList revokeAllPermissions(Grantee grantee) { Collection<Grant> grantsForGrantee = findGrantsForGrantee(grantee.getIdentifier()); grants.removeAll(grantsForGrantee); return this; }
/** * Revoke a permission for the given grantee, if this specific permission was granted. * * Note that you must be very explicit about the permissions you revoke, you cannot revoke * partial permissions and expect this class to determine the implied remaining permissions. For * example, if you revoke the {@link Permission#READ} permission from a grantee with * {@link Permission#FULL_CONTROL} access, <strong>the revocation will do nothing</strong> and * the grantee will retain full access. To change the access settings for this grantee, you must * first remove the {@link Permission#FULL_CONTROL} permission the add back the * {@link Permission#READ} permission. * * @param grantee * @param permission */ public AccessControlList revokePermission(Grantee grantee, String permission) { Collection<Grant> grantsForGrantee = findGrantsForGrantee(grantee.getIdentifier()); for (Grant grant : grantsForGrantee) { if (grant.getPermission().equals(permission)) { grants.remove(grant); } } return this; }
/** * Revoke a permission for the given grantee, if this specific permission was granted. * * Note that you must be very explicit about the permissions you revoke, you cannot revoke * partial permissions and expect this class to determine the implied remaining permissions. For * example, if you revoke the {@link Permission#READ} permission from a grantee with * {@link Permission#FULL_CONTROL} access, <strong>the revocation will do nothing</strong> and * the grantee will retain full access. To change the access settings for this grantee, you must * first remove the {@link Permission#FULL_CONTROL} permission the add back the * {@link Permission#READ} permission. * * @param grantee * @param permission */ public AccessControlList revokePermission(Grantee grantee, String permission) { Collection<Grant> grantsForGrantee = findGrantsForGrantee(grantee.getIdentifier()); for (Grant grant : grantsForGrantee) { if (grant.getPermission().equals(permission)) { grants.remove(grant); } } return this; }