- Set<String> intersection = new HashSet<String>(layerRoles);
- intersection.retainAll(userRoles);
- if (intersection.isEmpty())
+ boolean authorized = false;
+ authorized = cmsView.doAs(() -> {
+ for (String layerRole : layerRoles) {
+ if (CurrentUser.implies(layerRole, null)) {
+ return true;
+ }
+ }
+ return false;
+ });
+ if (!authorized)