diff --git a/src/main/java/info/bukova/isspst/security/IsspstPermissionEvaluator.java b/src/main/java/info/bukova/isspst/security/IsspstPermissionEvaluator.java index 574e30c1..4237338a 100644 --- a/src/main/java/info/bukova/isspst/security/IsspstPermissionEvaluator.java +++ b/src/main/java/info/bukova/isspst/security/IsspstPermissionEvaluator.java @@ -35,11 +35,14 @@ public class IsspstPermissionEvaluator implements PermissionEvaluator { perm += "_" + moduleId; - for (Role r : perms) { - if (r.getAuthority().equals(perm)) { + for (int i = 0; i < perms.size(); i++) { + if (!(perms.get(i) instanceof Role)) { + return false; + } + if (perms.get(i).getAuthority().equals(perm)) { return true; } - if (r.getAuthority().equals(Constants.ROLE_ADMIN)) { + if (perms.get(i).getAuthority().equals(Constants.ROLE_ADMIN)) { return true; } }