org.pentaho.platform.engine.security.acls
Class PentahoAclEntry

java.lang.Object
  extended by org.springframework.security.acl.basic.AbstractBasicAclEntry
      extended by org.pentaho.platform.engine.security.acls.PentahoAclEntry
All Implemented Interfaces:
Serializable, IPentahoAclEntry, org.springframework.security.acl.AclEntry, org.springframework.security.acl.basic.BasicAclEntry

public class PentahoAclEntry
extends org.springframework.security.acl.basic.AbstractBasicAclEntry
implements IPentahoAclEntry

Base Pentaho Access Control entry. Subclassed AbstractBasicAclEntry from Spring Security project. Provides known access controls.

Author:
mbatchel
See Also:
Serialized Form

Field Summary
 int recipientType
           
 
Fields inherited from interface org.pentaho.platform.api.engine.IPentahoAclEntry
PERM_ADMIN_ALL, PERM_ADMINISTRATION, PERM_CREATE, PERM_DELETE, PERM_EXECUTE, PERM_EXECUTE_ADMINISTRATION, PERM_EXECUTE_SUBSCRIBE, PERM_FULL_CONTROL, PERM_NOTHING, PERM_SUBSCRIBE, PERM_SUBSCRIBE_ADMINISTRATION, PERM_UPDATE, PERM_UPDATE_PERMS, PERMISSION_PREFIX, PERMISSIONS_LIST_ALL, PERMISSIONS_LIST_SOLUTIONS
 
Constructor Summary
PentahoAclEntry()
           
PentahoAclEntry(Object recipient, int mask)
           
 
Method Summary
 boolean equals(Object obj)
           
 int[] getValidPermissions()
          As implemented, this method says that all permission combinations are valid.
static Map getValidPermissionsNameMap()
           
static Map getValidPermissionsNameMap(String permissionsListType)
           
 int hashCode()
           
static void main(String[] args)
           
 String printPermissionsBlock(int i)
           
 void setRecipient(Object value)
           
 
Methods inherited from class org.springframework.security.acl.basic.AbstractBasicAclEntry
addPermission, addPermissions, deletePermission, deletePermissions, getAclObjectIdentity, getAclObjectParentIdentity, getMask, getRecipient, isPermitted, printPermissionsBlock, setAclObjectIdentity, setAclObjectParentIdentity, setMask, togglePermission, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.security.acl.basic.BasicAclEntry
getAclObjectIdentity, getAclObjectParentIdentity, getMask, getRecipient, isPermitted, setAclObjectIdentity, setAclObjectParentIdentity, setMask
 

Field Detail

recipientType

public int recipientType
Constructor Detail

PentahoAclEntry

public PentahoAclEntry()

PentahoAclEntry

public PentahoAclEntry(Object recipient,
                       int mask)
Method Detail

setRecipient

public void setRecipient(Object value)
Specified by:
setRecipient in interface org.springframework.security.acl.basic.BasicAclEntry
Overrides:
setRecipient in class org.springframework.security.acl.basic.AbstractBasicAclEntry

getValidPermissions

public int[] getValidPermissions()
As implemented, this method says that all permission combinations are valid. (Well not all. FULL_CONTROL must stand alone. It cannot be combined with other bits.)
  1. Find the permission value (call it p) that is the highest power of two.
  2. Find n (0-based) such that 2^n = p. (Uses logarithm with base 2.)
  3. So there are 2^(n+1) permutations of permission bits.
  4. So the valid permission values list consists of those 2^(n+1) permutations plus the FULL_CONTROL perm bit. (i.e. (2^(n+1))+1

Specified by:
getValidPermissions in class org.springframework.security.acl.basic.AbstractBasicAclEntry

main

public static void main(String[] args)

printPermissionsBlock

public String printPermissionsBlock(int i)
Specified by:
printPermissionsBlock in class org.springframework.security.acl.basic.AbstractBasicAclEntry

getValidPermissionsNameMap

public static Map getValidPermissionsNameMap()
Returns:
Returns the validPermissionsNameMap. This method is generally useful for UI work as it returns a Map of Permission atomic values (as Integer objects) keyed by a human readable permission name.

getValidPermissionsNameMap

public static Map getValidPermissionsNameMap(String permissionsListType)
Parameters:
permissionsListType - - The permissions list for solutions is different than that for other UIs
Returns:
Returns the validPermissionsNameMap. This method is generally useful for UI work as it returns a Map of Permission atomic values (as Integer objects) keyed by a human readable permission name.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object