org.acegisecurity.acls.domain
Class BasePermission

java.lang.Object
  extended by org.acegisecurity.acls.domain.BasePermission
All Implemented Interfaces:
Permission

public final class BasePermission
extends java.lang.Object
implements Permission

A set of standard permissions.

Version:
$Id: BasePermission.java 1868 2007-05-25 02:28:40Z benalex $
Author:
Ben Alex

Field Summary
static Permission ADMINISTRATION
           
static Permission CREATE
           
static Permission DELETE
           
static Permission READ
           
static Permission WRITE
           
 
Fields inherited from interface org.acegisecurity.acls.Permission
RESERVED_OFF, RESERVED_ON, THIRTY_TWO_RESERVED_OFF
 
Method Summary
static Permission buildFromMask(int mask)
          Dynamically creates a CumulativePermission or BasePermission representing the active bits in the passed mask.
static Permission[] buildFromMask(int[] masks)
           
static Permission buildFromName(java.lang.String name)
           
static Permission[] buildFromName(java.lang.String[] names)
           
 boolean equals(java.lang.Object arg0)
           
 int getMask()
          Returns the bits that represents the permission.
 java.lang.String getPattern()
          Returns a 32-character long bit pattern String representing this permission.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

READ

public static final Permission READ

WRITE

public static final Permission WRITE

CREATE

public static final Permission CREATE

DELETE

public static final Permission DELETE

ADMINISTRATION

public static final Permission ADMINISTRATION
Method Detail

buildFromMask

public static Permission buildFromMask(int mask)
Dynamically creates a CumulativePermission or BasePermission representing the active bits in the passed mask.

Parameters:
mask - to build
Returns:
a Permission representing the requested object

buildFromMask

public static Permission[] buildFromMask(int[] masks)

buildFromName

public static Permission buildFromName(java.lang.String name)

buildFromName

public static Permission[] buildFromName(java.lang.String[] names)

equals

public boolean equals(java.lang.Object arg0)
Overrides:
equals in class java.lang.Object

getMask

public int getMask()
Description copied from interface: Permission
Returns the bits that represents the permission.

Specified by:
getMask in interface Permission
Returns:
the bits that represent the permission

getPattern

public java.lang.String getPattern()
Description copied from interface: Permission
Returns a 32-character long bit pattern String representing this permission.

Implementations are free to format the pattern as they see fit, although under no circumstances may Permission.RESERVED_OFF or Permission.RESERVED_ON be used within the pattern. An exemption is in the case of Permission.RESERVED_OFF which is used to denote a bit that is off (clear). Implementations may also elect to use Permission.RESERVED_ON internally for computation purposes, although this method may not return any String containing Permission.RESERVED_ON.

The returned String must be 32 characters in length.

This method is only used for user interface and logging purposes. It is not used in any permission calculations. Therefore, duplication of characters within the output is permitted.

Specified by:
getPattern in interface Permission
Returns:
a 32-character bit pattern

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2004-2012 Interface21, Inc. All Rights Reserved.