From 746d01ebe6c2b13d6512428388514f1ef428ab37 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Sun, 25 May 2014 22:08:41 +0200 Subject: [PATCH] =?UTF-8?q?closes=20#73:=20Oprava=20chyby=20v=20kontrole?= =?UTF-8?q?=20pr=C3=A1v=20kdy=C5=BE=20je=20neplatn=C3=A1=20session.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../isspst/security/IsspstPermissionEvaluator.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; } }