org.squashtest.tm.service.security
Interface PermissionEvaluationService

All Known Implementing Classes:
AclPermissionEvaluationService

public interface PermissionEvaluationService

This service evaluates permissions of the current user.

Author:
Gregory Fouquet

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 permission, 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 permission, Long entityId, String entityClassName)
          Same as hasRoleOrPermissionOnObject(String, String, Object), except that Object is explicitly identified by its ID and classname
 boolean hasRoleOrPermissionOnObject(String role, String permission, 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.
 

Method Detail

hasRoleOrPermissionOnObject

boolean hasRoleOrPermissionOnObject(String role,
                                    String permission,
                                    Object object)
Parameters:
role -
permission - String representation of the permission.
object -
Returns:
true if the current user either has the given role or has the required permission on the given object.

hasRoleOrPermissionOnObject

boolean hasRoleOrPermissionOnObject(String role,
                                    String permission,
                                    Long entityId,
                                    String entityClassName)
Same as hasRoleOrPermissionOnObject(String, String, Object), except that Object is explicitly identified by its ID and classname

Parameters:
role -
permission -
entityId -
entityClassName -
Returns:

canRead

boolean canRead(Object object)
short hand for hasRoleOrPermissionOnObject('ROLE_ADMIN', 'READ', object);

Parameters:
object -
Returns:

hasMoreThanRead

boolean hasMoreThanRead(Object object)
return true if the user has more than readonly on the object

Parameters:
object -
Returns:

hasRole

boolean hasRole(String role)
return true if the user has the given role.

Parameters:
role -
Returns:

hasPermissionOnObject

boolean hasPermissionOnObject(String permission,
                              Long entityId,
                              String entityClassName)
returns true if the current user has the given permission on the object of the given id and classname.

Parameters:
permission -
entityId -
entityClassName -
Returns:
true if the current user has the given permission on the object of the given id and classname.

listPermissionsOnObject

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.

Parameters:
object -
Returns:


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