From 3c3cf5d46fe4591e7ea38a7090cec255a3a7a5e2 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Fri, 28 Nov 2014 10:15:56 +0100 Subject: [PATCH] =?UTF-8?q?Opravena=20kontrola=20pr=C3=A1v=20p=C5=99i=20ot?= =?UTF-8?q?v=C3=ADr=C3=A1n=C3=AD=20formul=C3=A1=C5=99e=20pro=20=C3=BApravu?= =?UTF-8?q?=20pr=C3=A1v=20na=20roli.=20closes=20#176?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../isspst/services/users/PermissionService.java | 3 +++ .../isspst/services/users/PermissionServiceImpl.java | 11 +++++++++-- .../info/bukova/isspst/ui/users/PermissionForm.java | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/java/info/bukova/isspst/services/users/PermissionService.java b/src/main/java/info/bukova/isspst/services/users/PermissionService.java index 7ffc0d54..fb308390 100644 --- a/src/main/java/info/bukova/isspst/services/users/PermissionService.java +++ b/src/main/java/info/bukova/isspst/services/users/PermissionService.java @@ -1,10 +1,13 @@ package info.bukova.isspst.services.users; +import java.util.List; + import info.bukova.isspst.data.Permission; import info.bukova.isspst.services.Service; public interface PermissionService extends Service { public Permission getPermissionByModule(String moduleId, String permission); + public List getAllPermissions(); } diff --git a/src/main/java/info/bukova/isspst/services/users/PermissionServiceImpl.java b/src/main/java/info/bukova/isspst/services/users/PermissionServiceImpl.java index adde62b9..dc9256e3 100644 --- a/src/main/java/info/bukova/isspst/services/users/PermissionServiceImpl.java +++ b/src/main/java/info/bukova/isspst/services/users/PermissionServiceImpl.java @@ -1,10 +1,12 @@ package info.bukova.isspst.services.users; -import org.springframework.transaction.annotation.Transactional; - import info.bukova.isspst.data.Permission; import info.bukova.isspst.services.AbstractService; +import java.util.List; + +import org.springframework.transaction.annotation.Transactional; + public class PermissionServiceImpl extends AbstractService implements PermissionService { @Override @@ -13,5 +15,10 @@ public class PermissionServiceImpl extends AbstractService implement return selectSingle("from Permission where MODULE = '" + moduleId + "' and AUTHORITY = '" + permission + "'"); } + @Override + @Transactional + public List getAllPermissions() { + return dao.getAll(); + } } diff --git a/src/main/java/info/bukova/isspst/ui/users/PermissionForm.java b/src/main/java/info/bukova/isspst/ui/users/PermissionForm.java index b5082dbe..6a4f14b6 100644 --- a/src/main/java/info/bukova/isspst/ui/users/PermissionForm.java +++ b/src/main/java/info/bukova/isspst/ui/users/PermissionForm.java @@ -30,7 +30,7 @@ public class PermissionForm extends FormViewModel { @Init(superclass = true) public void init() { - rolePerms = new RolePermissions(getDataBean(), permissionService.getAll()); + rolePerms = new RolePermissions(getDataBean(), permissionService.getAllPermissions()); // Pro PermissionService nelze nastavit práva, musí se volat jiná metoda než getAll() canChangeWorkgroup = roleService.canChangeWorkgroup(getDataBean()); canChangeCentre = roleService.canChangeCenter(getDataBean()); inWorkflow = roleService.isInWorkflow(getDataBean());