@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Grant other = (Grant) obj; if (grantee == null) { if (other.grantee != null) return false; } else if (!grantee.equals(other.grantee)) return false; if (permission == null) { if (other.permission != null) return false; } else if (!permission.equals(other.permission)) return false; return true; } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Grant other = (Grant) obj; if (grantee == null) { if (other.grantee != null) return false; } else if (!grantee.equals(other.grantee)) return false; if (permission == null) { if (other.permission != null) return false; } else if (!permission.equals(other.permission)) return false; return true; } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Grant other = (Grant) obj; if (grantee == null) { if (other.grantee != null) return false; } else if (!grantee.equals(other.grantee)) return false; if (permission == null) { if (other.permission != null) return false; } else if (!permission.equals(other.permission)) return false; return true; } }
/** * 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) { for (Iterator<Grant> it = grants.iterator(); it.hasNext();) { Grant grant = it.next(); if (grant.getGrantee().equals(grantee) && grant.getPermission().equals(permission)) { it.remove(); } } return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Grant other = (Grant) obj; if (grantee == null) { if (other.grantee != null) return false; } else if (!grantee.equals(other.grantee)) return false; if (permission == null) { if (other.permission != null) return false; } else if (!permission.equals(other.permission)) return false; return true; } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Grant other = (Grant) obj; if (grantee == null) { if (other.grantee != null) return false; } else if (!grantee.equals(other.grantee)) return false; if (permission == null) { if (other.permission != null) return false; } else if (!permission.equals(other.permission)) return false; return true; } }
/** * 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) { for (Iterator<Grant> it = grants.iterator(); it.hasNext();) { Grant grant = it.next(); if (grant.getGrantee().equals(grantee) && grant.getPermission().equals(permission)) { it.remove(); } } 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) { for (Iterator<Grant> it = grants.iterator(); it.hasNext();) { Grant grant = it.next(); if (grant.getGrantee().equals(grantee) && grant.getPermission().equals(permission)) { it.remove(); } } return this; }