November 2017
Intermediate to advanced
542 pages
14h 24m
English
A simplified version of our custom PermissionEvaluator that does not contain any validation can be seen as follows:
//src/main/java/com/packtpub/springsecurity/access/CalendarPermissionEvaluator.javapublic final class CalendarPermissionEvaluator implements PermissionEvaluator { private final EventDao eventDao; public CalendarPermissionEvaluator(EventDao eventDao) { this.eventDao = eventDao; } public boolean hasPermission(Authentication authentication, Object targetDomainObject, Object permission) { // should do instanceof check since could be any domain object return hasPermission(authentication, (Event) targetDomainObject, permission); } public boolean hasPermission(Authentication authentication, Serializable ...Read now
Unlock full access