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.AclEntryThis 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 booleanaddPermission(java.security.acl.Permission permission)A principal or a group can be associated with multiple permissions.booleancheckPermission(java.security.acl.Permission permission)Checks if the passed permission is part of the allowed permission set in this entry.java.lang.Objectclone()Clones an AclEntry.java.security.PrincipalgetPrincipal()Return the Principal associated in this ACL entry.booleanisNegative()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.booleanremovePermission(java.security.acl.Permission permission)The method disassociates the permission from the Principal or the Group in this ACL entry.voidsetNegativePermissions()This method sets the ACL to have negative permissions.booleansetPrincipal(java.security.Principal user)Sets the principal in the entity.java.lang.StringtoString()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:
setPrincipalin 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:
setNegativePermissionsin interfacejava.security.acl.AclEntry
-
isNegative
public boolean isNegative()
Returns true if this is a negative ACL.- Specified by:
isNegativein 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:
addPermissionin 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:
removePermissionin 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:
checkPermissionin 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:
permissionsin 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:
toStringin interfacejava.security.acl.AclEntry- Overrides:
toStringin classjava.lang.Object
-
clone
public java.lang.Object clone()
Clones an AclEntry.- Specified by:
clonein interfacejava.security.acl.AclEntry- Overrides:
clonein 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:
getPrincipalin interfacejava.security.acl.AclEntry
-
-