org.jboss.seam.security.permission
@Name(value="org.jboss.seam.security.jpaPermissionStore") @Install(precedence=0, value=false) @Scope(value=APPLICATION) @BypassInterceptors public class JpaPermissionStore extends Object implements PermissionStore, Serializable
Constructor and Description |
---|
JpaPermissionStore() |
Modifier and Type | Method and Description |
---|---|
void |
clearPermissions(Object target) |
protected javax.persistence.Query |
createPermissionQuery(Object target,
Set targets,
Principal recipient,
org.jboss.seam.security.permission.JpaPermissionStore.Discrimination discrimination)
Creates a Query that returns a list of permission records for the specified parameters.
|
Expressions.ValueExpression |
getEntityManager() |
Class |
getRolePermissionClass() |
Class |
getUserPermissionClass() |
boolean |
grantPermission(Permission permission) |
boolean |
grantPermissions(List<Permission> permissions) |
void |
init() |
protected void |
initProperties() |
List<String> |
listAvailableActions(Object target) |
List<Permission> |
listPermissions(Object target) |
protected List<Permission> |
listPermissions(Object target,
Set<Object> targets,
String action) |
List<Permission> |
listPermissions(Object target,
String action)
Returns a list of all user and role permissions for a specific permission target and action.
|
List<Permission> |
listPermissions(Set<Object> targets,
String action)
Returns a list of all user and role permissions for the specified action for all specified target objects
|
protected Principal |
resolvePrincipal(Object principal,
boolean isUser) |
protected Object |
resolvePrincipalEntity(Principal recipient)
If the user or role properties in the entity class refer to other entities, then this method
uses the JpaIdentityStore (if available) to lookup that user or role entity.
|
boolean |
revokePermission(Permission permission) |
boolean |
revokePermissions(List<Permission> permissions) |
void |
setEntityManager(Expressions.ValueExpression expression) |
void |
setRolePermissionClass(Class rolePermissionClass) |
void |
setUserPermissionClass(Class userPermissionClass) |
protected boolean |
updatePermissionActions(Object target,
Principal recipient,
String[] actions,
boolean set)
This is where the bulk of the actual work happens.
|
@Create public void init()
protected void initProperties()
protected javax.persistence.Query createPermissionQuery(Object target, Set targets, Principal recipient, org.jboss.seam.security.permission.JpaPermissionStore.Discrimination discrimination)
target
- The target of the permission, may be nulltargets
- A set of permission targets, may be nullrecipient
- The permission recipient, may be nulldiscrimination
- A discrimination (either user, role or both), requiredpublic boolean grantPermission(Permission permission)
grantPermission
in interface PermissionStore
public boolean revokePermission(Permission permission)
revokePermission
in interface PermissionStore
protected boolean updatePermissionActions(Object target, Principal recipient, String[] actions, boolean set)
target
- The target object to update permissions forrecipient
- The recipient to update permissions foractions
- The actions that will be updatedset
- true if the specified actions are to be granted, false if they are to be revokedpublic boolean grantPermissions(List<Permission> permissions)
grantPermissions
in interface PermissionStore
public boolean revokePermissions(List<Permission> permissions)
revokePermissions
in interface PermissionStore
protected Object resolvePrincipalEntity(Principal recipient)
recipient
- public List<Permission> listPermissions(Set<Object> targets, String action)
listPermissions
in interface PermissionStore
public List<Permission> listPermissions(Object target, String action)
listPermissions
in interface PermissionStore
protected List<Permission> listPermissions(Object target, Set<Object> targets, String action)
public List<Permission> listPermissions(Object target)
listPermissions
in interface PermissionStore
public List<String> listAvailableActions(Object target)
listAvailableActions
in interface PermissionStore
public Expressions.ValueExpression getEntityManager()
public void setEntityManager(Expressions.ValueExpression expression)
public Class getUserPermissionClass()
public void setUserPermissionClass(Class userPermissionClass)
public Class getRolePermissionClass()
public void setRolePermissionClass(Class rolePermissionClass)
public void clearPermissions(Object target)
clearPermissions
in interface PermissionStore
Copyright © 2015 Seam Framework. All Rights Reserved.