Opravena kontrola práv při otvírání formuláře pro úpravu práv na roli.

closes #176
Verze_1.0
Josef Rokos 10 years ago
parent 26e733a537
commit 3c3cf5d46f

@ -1,10 +1,13 @@
package info.bukova.isspst.services.users; package info.bukova.isspst.services.users;
import java.util.List;
import info.bukova.isspst.data.Permission; import info.bukova.isspst.data.Permission;
import info.bukova.isspst.services.Service; import info.bukova.isspst.services.Service;
public interface PermissionService extends Service<Permission> { public interface PermissionService extends Service<Permission> {
public Permission getPermissionByModule(String moduleId, String permission); public Permission getPermissionByModule(String moduleId, String permission);
public List<Permission> getAllPermissions();
} }

@ -1,10 +1,12 @@
package info.bukova.isspst.services.users; package info.bukova.isspst.services.users;
import org.springframework.transaction.annotation.Transactional;
import info.bukova.isspst.data.Permission; import info.bukova.isspst.data.Permission;
import info.bukova.isspst.services.AbstractService; import info.bukova.isspst.services.AbstractService;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
public class PermissionServiceImpl extends AbstractService<Permission> implements PermissionService { public class PermissionServiceImpl extends AbstractService<Permission> implements PermissionService {
@Override @Override
@ -13,5 +15,10 @@ public class PermissionServiceImpl extends AbstractService<Permission> implement
return selectSingle("from Permission where MODULE = '" + moduleId + "' and AUTHORITY = '" + permission + "'"); return selectSingle("from Permission where MODULE = '" + moduleId + "' and AUTHORITY = '" + permission + "'");
} }
@Override
@Transactional
public List<Permission> getAllPermissions() {
return dao.getAll();
}
} }

@ -30,7 +30,7 @@ public class PermissionForm extends FormViewModel<Role> {
@Init(superclass = true) @Init(superclass = true)
public void init() { 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()); canChangeWorkgroup = roleService.canChangeWorkgroup(getDataBean());
canChangeCentre = roleService.canChangeCenter(getDataBean()); canChangeCentre = roleService.canChangeCenter(getDataBean());
inWorkflow = roleService.isInWorkflow(getDataBean()); inWorkflow = roleService.isInWorkflow(getDataBean());

Loading…
Cancel
Save