List of usage examples for org.springframework.security.access PermissionEvaluator hasPermission
boolean hasPermission(Authentication authentication, Serializable targetId, String targetType,
Object permission);
From source file:org.collectionspace.services.authorization.spring.SpringPermissionEvaluator.java
@Override public boolean hasPermission(CSpaceResource res, CSpaceAction action) { Permission perm = SpringAuthorizationProvider.getPermission(action); Authentication authToken = SecurityContextHolder.getContext().getAuthentication(); Serializable objectIdId = SpringAuthorizationProvider.getObjectIdentityIdentifier(res); String objectIdType = SpringAuthorizationProvider.getObjectIdentityType(res); PermissionEvaluator eval = provider.getProviderPermissionEvaluator(); debug(res, authToken, objectIdId, objectIdType, perm); return eval.hasPermission(authToken, objectIdId, objectIdType, perm); }