Package java.security.acl
Interface AclEntry
- All Superinterfaces:
Cloneable
public interface AclEntry extends Cloneable
The Access Control List Entry interface definition.
An AclEntry is a list of the Permissions that are
granted (positive) or denied (negative) to a Principal.
-
Method Summary
Modifier and Type Method Description booleanaddPermission(Permission permission)Adds the specified permission to this ACL entry.booleancheckPermission(Permission permission)Checks whether the specified permission is in this ACL entry.Objectclone()Clones this ACL entry instance.PrincipalgetPrincipal()Returns the principal of this ACL entry.booleanisNegative()Returns whether this ACL entry is negative.Enumeration<Permission>permissions()Returns the list of permissions of this ACL entry.booleanremovePermission(Permission permission)Removes the specified permission from this ACL entry.voidsetNegativePermissions()Sets this ACL entry to be negative.booleansetPrincipal(Principal user)Set the principal for this ACL entry.StringtoString()Returns the string representation of this ACL entry.
-
Method Details
-
setPrincipal
Set the principal for this ACL entry.The principal for an ACL entry can only be set once.
- Parameters:
user- the principal for this ACL entry.- Returns:
trueon success,falseif there is a principal already set for this entry.
-
getPrincipal
Principal getPrincipal()Returns the principal of this ACL entry.- Returns:
- the principal of this ACL entry, or null if none is set.
-
setNegativePermissions
void setNegativePermissions()Sets this ACL entry to be negative.The permissions in this ACL entry will be denied to the principal associated with this entry.
Note: An ACL entry is positive by default and can only become negative by calling this method.
-
isNegative
boolean isNegative()Returns whether this ACL entry is negative.- Returns:
trueif this ACL entry is negative,falseif it's positive.
-
addPermission
Adds the specified permission to this ACL entry.- Parameters:
permission- the permission to be added.- Returns:
trueif the specified permission is added,falseif the permission was already in this entry.
-
removePermission
Removes the specified permission from this ACL entry.- Parameters:
permission- the permission to be removed.- Returns:
trueif the permission is removed,falseif the permission was not in this entry.
-
checkPermission
Checks whether the specified permission is in this ACL entry.- Parameters:
permission- the permission to check.- Returns:
trueif the permission is in this entry, otherwisefalse.
-
permissions
Enumeration<Permission> permissions()Returns the list of permissions of this ACL entry.- Returns:
- the list of permissions of this ACL entry,
-
toString
String toString()Returns the string representation of this ACL entry. -
clone
Object clone()Clones this ACL entry instance.- Returns:
- a copy of this entry.
-