
public final class ContextPermission extends Permission
ContextManager instances.
This type of permission requires a name and an action. The name may be the name
of a context manager, or the special * name which means the permission applies to all context managers.
The action may be one or more of the following (each action name being separated by a comma):
get - allow getting the current contextgetPrivilegedSupplier - allow access to the ContextManager.getPrivilegedSupplier() methodgetGlobalDefault - allow access to the global default contextsetGlobalDefault - allow setting the global default instancesetGlobalDefaultSupplier - allow setting the global default instance suppliergetThreadDefault - allow access to the per-thread default contextsetThreadDefault - allow setting the per-thread default instancesetThreadDefaultSupplier - allow setting the per-thread default instance supplier* action name is allowed which implies all of the above actions.
The newPermissionCollection() method returns an optimized container for context permissions.
| Constructor and Description |
|---|
ContextPermission(String name,
String actions)
Constructs a permission with the specified name.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(ContextPermission permission)
Determine if this permission is equal to the given permission.
|
boolean |
equals(Object obj)
Determine if this permission is equal to the given object.
|
String |
getActions()
Get the actions string.
|
int |
hashCode()
Get the hash code of this permission.
|
boolean |
implies(ContextPermission permission)
Determine if the given permission is implied by this permission.
|
boolean |
implies(Permission permission)
Determine if the given permission is implied by this permission.
|
PermissionCollection |
newPermissionCollection()
Get a new permission collection instance which can hold this type of permissions.
|
ContextPermission |
withActions(String actions)
Create a copy of this permission with the additional given actions.
|
ContextPermission |
withoutActions(String actions)
Create a copy of this permission without any of the given actions.
|
checkGuard, getName, toStringpublic boolean implies(Permission permission)
implies in class Permissionpermission - the other permissiontrue if the other permission is not null and is a context permission which is implied by
this permission instance; false otherwisepublic boolean implies(ContextPermission permission)
permission - the other permissiontrue if the other permission is not null and is a context permission which is implied by
this permission instance; false otherwisepublic boolean equals(Object obj)
equals in class Permissionobj - the other objecttrue if the object is a context permission that is exactly equal to this one; false otherwisepublic boolean equals(ContextPermission permission)
permission - the other permissiontrue if the permission is a context permission that is exactly equal to this one; false otherwisepublic int hashCode()
hashCode in class Permissionpublic String getActions()
getActions in class Permission@NotNull public ContextPermission withActions(String actions)
actions - the additional actions (must not be null)null)@NotNull public ContextPermission withoutActions(String actions)
actions - the actions to subtract (must not be null)null)public PermissionCollection newPermissionCollection()
newPermissionCollection in class Permissionnull)Copyright © 2015 JBoss, a division of Red Hat, Inc.