public enum Permission extends java.lang.Enum<Permission>
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 and Description |
---|
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.
|
Modifier and Type | Field and Description |
---|---|
private int |
denyValue |
private java.lang.String |
displayValue |
private int |
grantValue |
Modifier and Type | Method and Description |
---|---|
(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(java.util.Set<Permission> permissions)
Combine the given permission and convert to the integer deny value.
|
(package private) int |
denyValue() |
static java.util.Set<Permission> |
expand(java.util.Set<Permission> permissions)
Expand the given set of permissions to make sure it includes
all implicitely granted permissions.
|
(package private) static java.util.Set<Permission> |
fromDeniedInt(int permissions)
Convert an integer value to a set of denied permissions.
|
(package private) static java.util.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(java.util.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(java.lang.Integer... permissions)
Merges a list of integer permission values.
|
java.lang.String |
toString() |
static Permission |
valueOf(java.lang.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.
|
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.private final int grantValue
private final int denyValue
private final java.lang.String displayValue
public static Permission[] values()
for (Permission c : Permission.values()) System.out.println(c);
public static Permission valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullint grantValue()
int denyValue()
public java.lang.String toString()
toString
in class java.lang.Enum<Permission>
public static java.util.Set<Permission> expand(java.util.Set<Permission> permissions)
permissions
- The permissions to expandstatic 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(java.util.Set<Permission> permissions)
static int deny(Permission permission)
static int deny(Permission... permissions)
static int deny(java.util.Set<Permission> permissions)
static java.util.Set<Permission> fromInt(int permissions)
static java.util.Set<Permission> fromDeniedInt(int permissions)
static int merge(java.lang.Integer... permissions)
permissions
- The permission values, null values are ignored