public interface Policy extends Serializable, Persistent
| Modifier and Type | Method and Description |
|---|---|
void |
addPermission(Permission perm) |
void |
addPermission(Principal p,
Permission perm) |
Permission |
getPermission(Principal prpal,
Class<? extends Permission> permClass,
String permName)
Retrieve a permission.
|
Map<Principal,Permission> |
getPermissions(Object resource,
Class<? extends Permission> permClass)
Retrieve permissions assigned to the specified resource.
|
PermissionCollection |
getPermissions(Principal prpal) |
PermissionCollection |
getPermissions(Subject user) |
void |
removePermission(Permission perm)
Removes a permission attached to any principal.
|
void |
removePermission(Principal p,
Permission perm)
Removes a permission granted to the specified principal.
|
void |
removePermissions(Object resource) |
void |
removePermissions(Principal p,
String resourceName)
Removes all permission over a resource granted to a specified principal.
|
void |
removePermissions(String resourceName)
Removes all permission over a resource granted to any principal.
|
delete, isPersistent, save, updatevoid addPermission(Permission perm)
void addPermission(Principal p, Permission perm)
PermissionCollection getPermissions(Subject user)
PermissionCollection getPermissions(Principal prpal)
void removePermission(Permission perm)
void removePermission(Principal p, Permission perm)
IMPORTANT NOTE: This policy implementation is based on java.security.PermissionCollection class. Due to the fact that PermissionCollection doesn't offer any method for remove added permissions, our removePermission implementation regenerates the full structure of permissions attached to the principal for all permissions but those 'implied' by the permission to be removed.
void removePermissions(String resourceName)
void removePermissions(Principal p, String resourceName)
Map<Principal,Permission> getPermissions(Object resource, Class<? extends Permission> permClass) throws Exception
resource - The resource.permClass - The permission class.ExceptionPermission getPermission(Principal prpal, Class<? extends Permission> permClass, String permName)
prpal - The Principal for which the permission must be assigned.permClass - The class type of the permission.permName - The name of the permission.Copyright © 2012–2015 JBoss by Red Hat. All rights reserved.