org.squashtest.tm.service.security
Class PermissionsUtils

java.lang.Object
  extended by org.squashtest.tm.service.security.PermissionsUtils

public final class PermissionsUtils
extends Object


Method Summary
static void checkPermission(PermissionEvaluationService permissionService, List<Long> ids, String permission, String entityClassName)
          Wil check if the current user has sufficient rights on the entities of the given ids and classname.
static void checkPermission(PermissionEvaluationService permissionService, SecurityCheckableObject... checkableObjects)
          Will check if the current user has sufficient rights on the given checkable objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

checkPermission

public static void checkPermission(PermissionEvaluationService permissionService,
                                   SecurityCheckableObject... checkableObjects)
Will check if the current user has sufficient rights on the given checkable objects. If not will throw an AccessDeniedException.

Parameters:
permissionService - : the PermissionEvaluationService to use to do the check
checkableObjects - : the SecurityCheckableObjects to check
Throws:
org.springframework.security.access.AccessDeniedException

checkPermission

public static void checkPermission(PermissionEvaluationService permissionService,
                                   List<Long> ids,
                                   String permission,
                                   String entityClassName)
Wil check if the current user has sufficient rights on the entities of the given ids and classname. If not, will throw an AccessDeniedException

Parameters:
permissionService - : the PermissionEvaluationService to use to do the check
ids - : the ids of the entities to check the permissions on
permission - : the permission name to check
entityClassName - : the classname of the entities to check
Throws:
org.springframework.security.access.AccessDeniedException


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