Class 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 entry
      AclEntryImpl​(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
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AclEntryImpl

        public AclEntryImpl​(java.security.Principal user)
        Construct an ACL entry that associates a user with permissions in the ACL.
        Parameters:
        user - The user that is associated with this entry.
      • AclEntryImpl

        public AclEntryImpl()
        Construct a null ACL entry
    • 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 interface java.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 interface java.security.acl.AclEntry
      • isNegative

        public boolean isNegative()
        Returns true if this is a negative ACL.
        Specified by:
        isNegative in interface java.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 interface java.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 interface java.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 interface java.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 interface java.security.acl.AclEntry
      • toString

        @Deprecated
        public java.lang.String toString()
        Deprecated.
        Group and Permission in java.security.acl have been deprecated and marked for removal
        Return a string representation of the contents of the ACL entry.
        Specified by:
        toString in interface java.security.acl.AclEntry
        Overrides:
        toString in class java.lang.Object
      • clone

        public java.lang.Object clone()
        Clones an AclEntry.
        Specified by:
        clone in interface java.security.acl.AclEntry
        Overrides:
        clone in class java.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 interface java.security.acl.AclEntry