Hi Guys,
Is there a way to check my class object permissions directly from my code instead of having the annotation model,
Code:@PostAuthorize("hasPermission(returnObject, 'WRITE')") public BaseData getSingle(Long id);
Hi Guys,
Is there a way to check my class object permissions directly from my code instead of having the annotation model,
Code:@PostAuthorize("hasPermission(returnObject, 'WRITE')") public BaseData getSingle(Long id);
At-last after several tries i could achieve to get the solution, following is the code
acl-conf.xml
Code:... <bean class="org.springframework.security.acls.AclPermissionEvaluator" id="permissionEvaluator"> <constructor-arg ref="aclService"/> </bean> ...
samplecontroller.java
Code:@Autowired private PermissionEvaluator permissionEvaluator ; Permission permission = BasePermission.WRITE; permissionEvaluator.hasPermission(authentication,aclObject,permission); ....
Hope this is helpful.