Last update: 2011-06-23

org.proteios.core
Enum Permission

java.lang.Object
  extended by java.lang.Enum<Permission>
      extended by org.proteios.core.Permission
All Implemented Interfaces:
Serializable, Comparable<Permission>

public enum Permission
extends Enum<Permission>

This enumeration defined constants for permissions.

Version:
2.0
Author:
Nicklas
Developer info
Permissions are stored in the database as integers, which means that a given set of permissions must be combined before they are saved. We use the grantValue for this. This value is constructed in such a way that some permissions implicitly activates other permissions as follows: The denyValue is only used by the BasicItem.initPermissions(int, int) method when a subclass needs to deny a permission. This value is constructed in a similiar way:
Last modified
$Date: 2009-04-09 08:48:11 +0200 (Thu, 09 Apr 2009) $

Enum Constant Summary
ACT_AS_ANOTHER_USER
          This permission allows a user act as another user using the SessionControl.impersonateLogin(int, String) method.
CREATE
          This permission allows a user create new items.
DELETE
          This permission allows a user delete an item.
DENIED
          This permission denies a user access to an item.
READ
          This permission allows a user read information about an item.
RESTRICTED_WRITE
          This permission allows a user to update some information about an item.
SET_OWNER
          This permission allows a user change the owner of an item.
SET_PERMISSION
          This permission allows a user change the access permission to an item.
SHARE_TO_EVERYONE
          This permission allows a user to share an item to the Group.EVERYONE group.
USE
          This permission allows a user to use/link to an item.
WRITE
          This permission allows a user update the information about an item.
 
Method Summary
 String toString()
           
static Permission valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Permission[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

READ

public static final Permission READ
This permission allows a user read information about an item.


USE

public static final Permission USE
This permission allows a user to use/link to an item.


RESTRICTED_WRITE

public static final Permission RESTRICTED_WRITE
This permission allows a user to update some information about an item.


WRITE

public static final Permission WRITE
This permission allows a user update the information about an item.


DELETE

public static final Permission DELETE
This permission allows a user delete an item.


SET_OWNER

public static final Permission SET_OWNER
This permission allows a user change the owner of an item.


SET_PERMISSION

public static final Permission SET_PERMISSION
This permission allows a user change the access permission to an item.


CREATE

public static final Permission CREATE
This permission allows a user create new items.


DENIED

public static final Permission DENIED
This permission denies a user access to an item. This permission can only be given to RoleKey:s.


SHARE_TO_EVERYONE

public static final Permission SHARE_TO_EVERYONE
This permission allows a user to share an item to the Group.EVERYONE group. This is a system permission and is only meaningful for the role key for the Item.SYSTEM item.


ACT_AS_ANOTHER_USER

public static final Permission ACT_AS_ANOTHER_USER
This permission allows a user act as another user using the SessionControl.impersonateLogin(int, String) method. This is a system permission and is only meaningful for the role key for the Item.SYSTEM item.

Method Detail

values

public static Permission[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Permission c : Permission.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Permission valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

toString

public String toString()
Overrides:
toString in class Enum<Permission>

Last update: 2011-06-23