Opravena kontrola práv při otvírání formuláře pro úpravu práv na roli.
closes #176
This commit is contained in:
@@ -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<Permission> {
|
||||
|
||||
public Permission getPermissionByModule(String moduleId, String permission);
|
||||
public List<Permission> getAllPermissions();
|
||||
|
||||
}
|
||||
|
||||
@@ -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<Permission> implements PermissionService {
|
||||
|
||||
@Override
|
||||
@@ -13,5 +15,10 @@ public class PermissionServiceImpl extends AbstractService<Permission> implement
|
||||
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)
|
||||
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());
|
||||
|
||||
Reference in New Issue
Block a user