org.squashtest.tm.service.internal.security
Class AclPermissionEvaluationService

java.lang.Object
  extended by org.squashtest.tm.service.internal.security.AclPermissionEvaluationService
All Implemented Interfaces:
PermissionEvaluationService

@Service(value="squashtest.core.security.PermissionEvaluationService")
@Transactional(readOnly=true)
public class AclPermissionEvaluationService
extends Object
implements PermissionEvaluationService


Constructor Summary
AclPermissionEvaluationService()
           
 
Method Summary
 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 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<org.springframework.security.acls.model.Permission,Boolean> listPermissionsOnObject(Object object)
          returns all existing permissions and says which of those the user is granted on the given object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AclPermissionEvaluationService

public AclPermissionEvaluationService()
Method Detail

hasRoleOrPermissionOnObject

public boolean hasRoleOrPermissionOnObject(String role,
                                           String permissionName,
                                           Object object)
Specified by:
hasRoleOrPermissionOnObject in interface PermissionEvaluationService
permissionName - String representation of the permission.
Returns:
true if the current user either has the given role or has the required permission on the given object.

hasRoleOrPermissionOnObject

public boolean hasRoleOrPermissionOnObject(String role,
                                           String permissionName,
                                           Long entityId,
                                           String entityClassName)
Description copied from interface: PermissionEvaluationService
Same as PermissionEvaluationService.hasRoleOrPermissionOnObject(String, String, Object), except that Object is explicitly identified by its ID and classname

Specified by:
hasRoleOrPermissionOnObject in interface PermissionEvaluationService
Returns:

canRead

public boolean canRead(Object object)
Description copied from interface: PermissionEvaluationService
short hand for hasRoleOrPermissionOnObject('ROLE_ADMIN', 'READ', object);

Specified by:
canRead in interface PermissionEvaluationService
Returns:

hasRole

public boolean hasRole(String role)
Description copied from interface: PermissionEvaluationService
return true if the user has the given role.

Specified by:
hasRole in interface PermissionEvaluationService
Returns:

hasMoreThanRead

public boolean hasMoreThanRead(Object object)
Description copied from interface: PermissionEvaluationService
return true if the user has more than readonly on the object

Specified by:
hasMoreThanRead in interface PermissionEvaluationService
Returns:

hasPermissionOnObject

public boolean hasPermissionOnObject(String permissionName,
                                     Long entityId,
                                     String entityClassName)
Description copied from interface: PermissionEvaluationService
returns true if the current user has the given permission on the object of the given id and classname.

Specified by:
hasPermissionOnObject in interface PermissionEvaluationService
Returns:
true if the current user has the given permission on the object of the given id and classname.

listPermissionsOnObject

public Map<org.springframework.security.acls.model.Permission,Boolean> listPermissionsOnObject(Object object)
Description copied from interface: PermissionEvaluationService
returns all existing permissions and says which of those the user is granted on the given object.

Specified by:
listPermissionsOnObject in interface PermissionEvaluationService
Returns:


Copyright © 2010-2013 Henix, henix.fr. All Rights Reserved.