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());