Class PentahoAbstractBasicAclEntry

  • All Implemented Interfaces:
    Serializable, org.pentaho.platform.api.engine.IAclEntry, org.pentaho.platform.api.engine.IPentahoBasicAclEntry
    Direct Known Subclasses:

    public abstract class PentahoAbstractBasicAclEntry
    extends Object
    implements org.pentaho.platform.api.engine.IPentahoBasicAclEntry
    This is a port from spring-security 2.0.8.RELEASE
    See Also:
    Serialized Form
    • Constructor Detail

      • PentahoAbstractBasicAclEntry

        public PentahoAbstractBasicAclEntry​(Object recipient,
                                            org.pentaho.platform.api.engine.IPentahoAclObjectIdentity aclObjectIdentity,
                                            org.pentaho.platform.api.engine.IPentahoAclObjectIdentity aclObjectParentIdentity,
                                            int mask)
      • PentahoAbstractBasicAclEntry

        protected PentahoAbstractBasicAclEntry()
        A protected constructor for use by Hibernate.
    • Method Detail

      • addPermission

        public int addPermission​(int permissionToAdd)
      • addPermissions

        public int addPermissions​(int[] permissionsToAdd)
      • deletePermission

        public int deletePermission​(int permissionToDelete)
      • deletePermissions

        public int deletePermissions​(int[] permissionsToDelete)
      • getAclObjectIdentity

        public org.pentaho.platform.api.engine.IPentahoAclObjectIdentity getAclObjectIdentity()
        Specified by:
        getAclObjectIdentity in interface org.pentaho.platform.api.engine.IPentahoBasicAclEntry
      • getAclObjectParentIdentity

        public org.pentaho.platform.api.engine.IPentahoAclObjectIdentity getAclObjectParentIdentity()
        Specified by:
        getAclObjectParentIdentity in interface org.pentaho.platform.api.engine.IPentahoBasicAclEntry
      • getMask

        public int getMask()
        Specified by:
        getMask in interface org.pentaho.platform.api.engine.IPentahoBasicAclEntry
      • getRecipient

        public Object getRecipient()
        Specified by:
        getRecipient in interface org.pentaho.platform.api.engine.IPentahoBasicAclEntry
      • getValidPermissions

        public abstract int[] getValidPermissions()
        Subclasses must indicate the permissions they support. Each base permission should be an integer with a base 2. ie: the first permission is 2^^0 (1), the second permission is 2^^1 (2), the third permission is 2^^2 (4) etc. Each base permission should be exposed by the subclass as a public static final int. It is further recommended that valid combinations of permissions are also exposed as public static final ints.

        This method returns all permission integers that are allowed to be used together. This must include any combinations of valid permissions. So if the permissions indicated by 2^^2 (4) and 2^^1 (2) can be used together, one of the integers returned by this method must be 6 (4 + 2). Otherwise attempts to set the permission will be rejected, as the final resulting mask will be rejected.

        Whilst it may seem unduly time onerous to return every valid permission combination, doing so delivers maximum flexibility in ensuring ACLs only reflect logical combinations. For example, it would be inappropriate to grant a "read" and "write" permission along with an "unrestricted" permission, as the latter implies the former permissions.

        every valid combination of permissions
      • isPermitted

        public boolean isPermitted​(int permissionToCheck)
        Specified by:
        isPermitted in interface org.pentaho.platform.api.engine.IPentahoBasicAclEntry
      • isPermitted

        protected boolean isPermitted​(int maskToCheck,
                                      int permissionToCheck)
      • printPermissionsBlock

        public abstract String printPermissionsBlock​(int i)
        Outputs the permissions in a human-friendly format. For example, this method may return "CR-D" to indicate the passed integer permits create, permits read, does not permit update, and permits delete.
        i - the integer containing the mask which should be printed
        the human-friend formatted block
      • printPermissionsBlock

        public String printPermissionsBlock()
        Outputs the permissions in human-friendly format for the current AbstractBasicAclEntry's mask.
        the human-friendly formatted block for this instance
      • setAclObjectIdentity

        public void setAclObjectIdentity​(org.pentaho.platform.api.engine.IPentahoAclObjectIdentity aclObjectIdentity)
        Specified by:
        setAclObjectIdentity in interface org.pentaho.platform.api.engine.IPentahoBasicAclEntry
      • setAclObjectParentIdentity

        public void setAclObjectParentIdentity​(org.pentaho.platform.api.engine.IPentahoAclObjectIdentity aclObjectParentIdentity)
        Specified by:
        setAclObjectParentIdentity in interface org.pentaho.platform.api.engine.IPentahoBasicAclEntry
      • setMask

        public void setMask​(int mask)
        Specified by:
        setMask in interface org.pentaho.platform.api.engine.IPentahoBasicAclEntry
      • setRecipient

        public void setRecipient​(Object recipient)
        Specified by:
        setRecipient in interface org.pentaho.platform.api.engine.IPentahoBasicAclEntry
      • togglePermission

        public int togglePermission​(int permissionToToggle)