|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Object java.lang.Enum<Permission> net.sf.basedb.core.Permission
public enum Permission
This enumeration defined constants for permissions.
grantValue
for this. This value is constructed
in such a way that some permissions implicitly activates other permissions
as follows:
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:
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. |
|
SELECT_JOBAGENT
This permission allows a user to specify which job agent a job should be executed on using Job.setJobAgent(JobAgent) . |
|
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. |
Field Summary | |
---|---|
private int |
denyValue
|
private String |
displayValue
|
private int |
grantValue
|
Method Summary | |
---|---|
(package private) static int |
deny(Permission... permissions)
Combine the given permissions and convert to the integer deny value. |
(package private) static int |
deny(Permission permission)
Convert the given permission to the integer deny value. |
(package private) static int |
deny(Set<Permission> permissions)
Combine the given permission and convert to the integer deny value. |
(package private) int |
denyValue()
|
static Set<Permission> |
expand(Set<Permission> permissions)
Expand the given set of permissions to make sure it includes all implicitely granted permissions. |
(package private) static Set<Permission> |
fromDeniedInt(int permissions)
Convert an integer value to a set of denied permissions. |
(package private) static Set<Permission> |
fromInt(int permissions)
Convert an integer value to a set of granted permissions. |
(package private) static int |
grant(Permission... permissions)
Combine the given permissions and convert to the integer grant value. |
(package private) static int |
grant(Permission permission)
Convert the given permission to the integer grant value. |
(package private) static int |
grant(Set<Permission> permissions)
Combine the given permission and convert to the integer grant value. |
(package private) int |
grantValue()
|
(package private) static boolean |
hasPermission(int permissions,
Permission permission)
Checks if the given Permission is granted by the
permissions code. |
(package private) static boolean |
isDeniedPermission(int permissions,
Permission permission)
Checks if the given Permission is denied by the
permissions code. |
(package private) static int |
merge(Integer... permissions)
Merges a list of integer permission values. |
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 |
---|
public static final Permission READ
public static final Permission USE
public static final Permission RESTRICTED_WRITE
public static final Permission WRITE
public static final Permission DELETE
public static final Permission SET_OWNER
public static final Permission SET_PERMISSION
public static final Permission CREATE
public static final Permission DENIED
RoleKey
:s.
public static final Permission SHARE_TO_EVERYONE
Group.EVERYONE
group. This is a system permission and is only meaningful for the role key
for the Item.SYSTEM
item.
public static final Permission ACT_AS_ANOTHER_USER
SessionControl.impersonateLogin(int, String)
method. This is a system
permission and is only meaningful for the role key for the Item.SYSTEM
item.
public static final Permission SELECT_JOBAGENT
Job.setJobAgent(JobAgent)
.
This is a system permission and is only meaningful for the role key
for the Item.SYSTEM
item.
Field Detail |
---|
private final int grantValue
private final int denyValue
private final String displayValue
Method Detail |
---|
public static Permission[] values()
for (Permission c : Permission.values()) System.out.println(c);
public static Permission valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is nullint grantValue()
int denyValue()
public String toString()
toString
in class Enum<Permission>
public static Set<Permission> expand(Set<Permission> permissions)
permissions
- The permissions to expand
static boolean hasPermission(int permissions, Permission permission)
Permission
is granted by the
permissions
code.
permissions
- The permission combinationpermission
- The permission to checkstatic boolean isDeniedPermission(int permissions, Permission permission)
Permission
is denied by the
permissions
code.
permissions
- The permission combinationpermission
- The permission to checkstatic int grant(Permission permission)
static int grant(Permission... permissions)
static int grant(Set<Permission> permissions)
static int deny(Permission permission)
static int deny(Permission... permissions)
static int deny(Set<Permission> permissions)
static Set<Permission> fromInt(int permissions)
static Set<Permission> fromDeniedInt(int permissions)
static int merge(Integer... permissions)
permissions
- The permission values, null values are ignored
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |