Spring Security Framework

org.springframework.security.acl.basic
Class SimpleAclEntry

java.lang.Object
  extended by org.springframework.security.acl.basic.AbstractBasicAclEntry
      extended by org.springframework.security.acl.basic.SimpleAclEntry
All Implemented Interfaces:
Serializable, AclEntry, BasicAclEntry

Deprecated. Use new spring-security-acl module instead

public class SimpleAclEntry
extends AbstractBasicAclEntry

Stores some privileges typical of a domain object.

Version:
$Id$
Author:
Ben Alex
See Also:
Serialized Form

Field Summary
static int ADMINISTRATION
          Deprecated.  
static int CREATE
          Deprecated.  
static int DELETE
          Deprecated.  
static int NOTHING
          Deprecated.  
static int READ
          Deprecated.  
static int READ_WRITE
          Deprecated.  
static int READ_WRITE_CREATE
          Deprecated.  
static int READ_WRITE_CREATE_DELETE
          Deprecated.  
static int READ_WRITE_DELETE
          Deprecated.  
static int WRITE
          Deprecated.  
 
Constructor Summary
SimpleAclEntry()
          Deprecated. Allows BasicAclDao implementations to construct this object using newInstance().
SimpleAclEntry(Object recipient, AclObjectIdentity aclObjectIdentity, AclObjectIdentity aclObjectParentIdentity, int mask)
          Deprecated.  
 
Method Summary
 int[] getValidPermissions()
          Deprecated. Subclasses must indicate the permissions they support.
static int parsePermission(String permission)
          Deprecated. Parse a permission String literal and return associated value.
static int[] parsePermissions(String[] permissions)
          Deprecated. Parse a list of permission String literals and return associated values.
 String printPermissionsBlock(int i)
          Deprecated. Outputs the permissions in a human-friendly format.
 
Methods inherited from class org.springframework.security.acl.basic.AbstractBasicAclEntry
addPermission, addPermissions, deletePermission, deletePermissions, getAclObjectIdentity, getAclObjectParentIdentity, getMask, getRecipient, isPermitted, isPermitted, printPermissionsBlock, setAclObjectIdentity, setAclObjectParentIdentity, setMask, setRecipient, togglePermission, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NOTHING

public static final int NOTHING
Deprecated. 
See Also:
Constant Field Values

ADMINISTRATION

public static final int ADMINISTRATION
Deprecated. 

READ

public static final int READ
Deprecated. 

WRITE

public static final int WRITE
Deprecated. 

CREATE

public static final int CREATE
Deprecated. 

DELETE

public static final int DELETE
Deprecated. 

READ_WRITE_CREATE_DELETE

public static final int READ_WRITE_CREATE_DELETE
Deprecated. 

READ_WRITE_CREATE

public static final int READ_WRITE_CREATE
Deprecated. 

READ_WRITE

public static final int READ_WRITE
Deprecated. 

READ_WRITE_DELETE

public static final int READ_WRITE_DELETE
Deprecated. 
Constructor Detail

SimpleAclEntry

public SimpleAclEntry()
Deprecated. 
Allows BasicAclDao implementations to construct this object using newInstance().

Normal classes should not use this default constructor.


SimpleAclEntry

public SimpleAclEntry(Object recipient,
                      AclObjectIdentity aclObjectIdentity,
                      AclObjectIdentity aclObjectParentIdentity,
                      int mask)
Deprecated. 
Method Detail

getValidPermissions

public int[] getValidPermissions()
Deprecated. 
Description copied from class: AbstractBasicAclEntry
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.

Specified by:
getValidPermissions in class AbstractBasicAclEntry
Returns:
a copy of the permissions array, changes to the values won't affect this class.

printPermissionsBlock

public String printPermissionsBlock(int i)
Deprecated. 
Description copied from class: AbstractBasicAclEntry
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.

Specified by:
printPermissionsBlock in class AbstractBasicAclEntry
Parameters:
i - the integer containing the mask which should be printed
Returns:
the human-friend formatted block

parsePermission

public static int parsePermission(String permission)
Deprecated. 
Parse a permission String literal and return associated value.

Parameters:
permission - one of the field names that represent a permission: ADMINISTRATION, READ, WRITE,...
Returns:
the value associated to that permission
Throws:
IllegalArgumentException - if argument is not a valid permission

parsePermissions

public static int[] parsePermissions(String[] permissions)
Deprecated. 
Parse a list of permission String literals and return associated values.

Parameters:
permissions - array with permissions as String
See Also:
for valid values

Spring Security Framework

Copyright © 2004-2010 SpringSource, Inc. All Rights Reserved.