Class AclEntryImpl
- java.lang.Object
-
- org.mozilla.jss.netscape.security.acl.AclEntryImpl
-
- All Implemented Interfaces:
java.lang.Cloneable
,java.security.acl.AclEntry
public class AclEntryImpl extends java.lang.Object implements java.security.acl.AclEntry
This is a class that describes one entry that associates users or groups with permissions in the ACL. The entry may be used as a way of granting or denying permissions.
-
-
Constructor Summary
Constructors Constructor Description AclEntryImpl()
Construct a null ACL entryAclEntryImpl(java.security.Principal user)
Construct an ACL entry that associates a user with permissions in the ACL.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
addPermission(java.security.acl.Permission permission)
A principal or a group can be associated with multiple permissions.boolean
checkPermission(java.security.acl.Permission permission)
Checks if the passed permission is part of the allowed permission set in this entry.java.lang.Object
clone()
Clones an AclEntry.java.security.Principal
getPrincipal()
Return the Principal associated in this ACL entry.boolean
isNegative()
Returns true if this is a negative ACL.java.util.Enumeration<java.security.acl.Permission>
permissions()
return an enumeration of the permissions in this ACL entry.boolean
removePermission(java.security.acl.Permission permission)
The method disassociates the permission from the Principal or the Group in this ACL entry.void
setNegativePermissions()
This method sets the ACL to have negative permissions.boolean
setPrincipal(java.security.Principal user)
Sets the principal in the entity.java.lang.String
toString()
Deprecated.Group and Permission in java.security.acl have been deprecated and marked for removal
-
-
-
Method Detail
-
setPrincipal
public boolean setPrincipal(java.security.Principal user)
Sets the principal in the entity. If a group or a principal had already been set, a false value is returned, otherwise a true value is returned.- Specified by:
setPrincipal
in interfacejava.security.acl.AclEntry
- Parameters:
user
- The user that is associated with this entry.- Returns:
- true if the principal is set, false if there is one already.
-
setNegativePermissions
public void setNegativePermissions()
This method sets the ACL to have negative permissions. That is the user or group is denied the permission set specified in the entry.- Specified by:
setNegativePermissions
in interfacejava.security.acl.AclEntry
-
isNegative
public boolean isNegative()
Returns true if this is a negative ACL.- Specified by:
isNegative
in interfacejava.security.acl.AclEntry
-
addPermission
public boolean addPermission(java.security.acl.Permission permission)
A principal or a group can be associated with multiple permissions. This method adds a permission to the ACL entry.- Specified by:
addPermission
in interfacejava.security.acl.AclEntry
- Parameters:
permission
- The permission to be associated with the principal or the group in the entry.- Returns:
- true if the permission was added, false if the permission was already part of the permission set.
-
removePermission
public boolean removePermission(java.security.acl.Permission permission)
The method disassociates the permission from the Principal or the Group in this ACL entry.- Specified by:
removePermission
in interfacejava.security.acl.AclEntry
- Parameters:
permission
- The permission to be disassociated with the principal or the group in the entry.- Returns:
- true if the permission is removed, false if the permission is not part of the permission set.
-
checkPermission
public boolean checkPermission(java.security.acl.Permission permission)
Checks if the passed permission is part of the allowed permission set in this entry.- Specified by:
checkPermission
in interfacejava.security.acl.AclEntry
- Parameters:
permission
- The permission that has to be part of the permission set in the entry.- Returns:
- true if the permission passed is part of the permission set in the entry, false otherwise.
-
permissions
public java.util.Enumeration<java.security.acl.Permission> permissions()
return an enumeration of the permissions in this ACL entry.- Specified by:
permissions
in interfacejava.security.acl.AclEntry
-
toString
@Deprecated public java.lang.String toString()
Deprecated.Group and Permission in java.security.acl have been deprecated and marked for removalReturn a string representation of the contents of the ACL entry.- Specified by:
toString
in interfacejava.security.acl.AclEntry
- Overrides:
toString
in classjava.lang.Object
-
clone
public java.lang.Object clone()
Clones an AclEntry.- Specified by:
clone
in interfacejava.security.acl.AclEntry
- Overrides:
clone
in classjava.lang.Object
-
getPrincipal
public java.security.Principal getPrincipal()
Return the Principal associated in this ACL entry. The method returns null if the entry uses a group instead of a principal.- Specified by:
getPrincipal
in interfacejava.security.acl.AclEntry
-
-