com.taggercat.security
Class Permission

java.lang.Object
  extended by com.taggercat.security.Permission

public class Permission
extends java.lang.Object

The Permission class provides static methods and constants to decode security permissions. The sets of permissions are represented as integers with distinct bit positions representing the different permission values.

 

Field Summary
static int ALL_PERMISSIONS
          The int value representing the DELETE permission.
static int DELETE_PERMISSION
          The int value representing the DELETE permission.
static int INSERT_PERMISSION
          The int value representing the INSERT permission.
static int UPDATE_PERMISSION
          The int value representing the UPDATE permission.
static int VIEW_PERMISSION
          The int value representing the VIEW permission.
 
Method Summary
static boolean isDelete(int permissions)
          Return true if the integer argument includes the DELETE_PERMISSION permission, false otherwise.
static boolean isInsert(int permissions)
          Return true if the integer argument includes the INSERT_PERMISSION permission, false otherwise.
static boolean isUpdate(int permissions)
          Return true if the integer argument includes the UPDATE_PERMISSION permission, false otherwise.
static boolean isView(int permissions)
          Return true if the integer argument includes the VIEW_PERMISSION permission, false otherwise.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VIEW_PERMISSION

public static final int VIEW_PERMISSION
The int value representing the VIEW permission.

See Also:
Constant Field Values

UPDATE_PERMISSION

public static final int UPDATE_PERMISSION
The int value representing the UPDATE permission.

See Also:
Constant Field Values

INSERT_PERMISSION

public static final int INSERT_PERMISSION
The int value representing the INSERT permission.

See Also:
Constant Field Values

DELETE_PERMISSION

public static final int DELETE_PERMISSION
The int value representing the DELETE permission.

See Also:
Constant Field Values

ALL_PERMISSIONS

public static final int ALL_PERMISSIONS
The int value representing the DELETE permission.

See Also:
Constant Field Values
Method Detail

isUpdate

public static boolean isUpdate(int permissions)
Return true if the integer argument includes the UPDATE_PERMISSION permission, false otherwise.

Parameters:
permissions - a set of permissions
Returns:
true if permissions includes the UPDATE_PERMISSION permission; false otherwise.

isInsert

public static boolean isInsert(int permissions)
Return true if the integer argument includes the INSERT_PERMISSION permission, false otherwise.

Parameters:
permissions - a set of permissions
Returns:
true if permissions includes the INSERT_PERMISSION permission; false otherwise.

isView

public static boolean isView(int permissions)
Return true if the integer argument includes the VIEW_PERMISSION permission, false otherwise.

Parameters:
permissions - a set of permissions
Returns:
true if permissions includes the VIEW_PERMISSION permission; false otherwise.

isDelete

public static boolean isDelete(int permissions)
Return true if the integer argument includes the DELETE_PERMISSION permission, false otherwise.

Parameters:
permissions - a set of permissions
Returns:
true if permissions includes the DELETE_PERMISSION permission; false otherwise.