@Service(value="squashtest.core.security.PermissionEvaluationService") @Transactional(readOnly=true) public class AclPermissionEvaluationService extends Object implements PermissionEvaluationService
| Constructor and Description |
|---|
AclPermissionEvaluationService() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRead(Object object)
short hand for hasRoleOrPermissionOnObject('ROLE_ADMIN', 'READ', object);
|
boolean |
hasMoreThanRead(Object object)
return true if the user has more than readonly on the object
|
boolean |
hasPermissionOnObject(String permissionName,
Long entityId,
String entityClassName)
returns
true if the current user has the given permission on the object of the given id and classname. |
boolean |
hasPermissionOnObject(String permission,
Object entity) |
boolean |
hasRole(String role)
return true if the user has the given role.
|
boolean |
hasRoleOrPermissionOnObject(String role,
String permissionName,
Long entityId,
String entityClassName)
Same as
PermissionEvaluationService.hasRoleOrPermissionOnObject(String, String, Object), except that Object is explicitly identified
by its ID and classname |
boolean |
hasRoleOrPermissionOnObject(String role,
String permissionName,
Object object) |
Map<String,Boolean> |
hasRoleOrPermissionsOnObject(String role,
String[] permissions,
Object entity) |
Collection<String> |
permissionsOn(String className,
long id)
returns the list of all permissions the curent user has on en entity refernced by its classname and identifier.
|
public boolean hasRoleOrPermissionOnObject(String role, String permissionName, Object object)
hasRoleOrPermissionOnObject in interface PermissionEvaluationServicepermissionName - String representation of the permission.public boolean hasPermissionOnObject(String permission, Object entity)
hasPermissionOnObject in interface PermissionEvaluationServicepermission - String representation of the permission.PermissionEvaluationService.hasPermissionOnObject(String, Object)public boolean hasRoleOrPermissionOnObject(String role, String permissionName, Long entityId, String entityClassName)
PermissionEvaluationServicePermissionEvaluationService.hasRoleOrPermissionOnObject(String, String, Object), except that Object is explicitly identified
by its ID and classnamehasRoleOrPermissionOnObject in interface PermissionEvaluationServicepublic boolean canRead(Object object)
PermissionEvaluationServicecanRead in interface PermissionEvaluationService@Transactional(propagation=SUPPORTS) public boolean hasRole(String role)
PermissionEvaluationServicehasRole in interface PermissionEvaluationServicepublic boolean hasMoreThanRead(Object object)
PermissionEvaluationServicehasMoreThanRead in interface PermissionEvaluationServicepublic boolean hasPermissionOnObject(String permissionName, Long entityId, String entityClassName)
PermissionEvaluationServicetrue if the current user has the given permission on the object of the given id and classname.hasPermissionOnObject in interface PermissionEvaluationServicetrue if the current user has the given permission on the object of the given id and classname.public Map<String,Boolean> hasRoleOrPermissionsOnObject(String role, String[] permissions, Object entity)
hasRoleOrPermissionsOnObject in interface PermissionEvaluationServicepermissions - String representation of the permission.public Collection<String> permissionsOn(@NotNull String className, long id)
PermissionEvaluationServicepermissionsOn in interface PermissionEvaluationServiceclassName - class name of the entityid - identifier of the entityCopyright © 2010–2017 Henix, henix.fr. All rights reserved.