Opravena kontrola práv v agendě "Schválené položky požadavků".

refs #183
Verze_1.0
Josef Rokos 10 years ago
parent e51955f86a
commit 780edd5678

@ -7,6 +7,7 @@ import info.bukova.isspst.data.PermissionType;
import info.bukova.isspst.data.Role;
import info.bukova.isspst.data.User;
import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.services.Service;
import info.bukova.isspst.services.workgroups.WorkgroupService;
import java.util.List;
@ -42,13 +43,22 @@ public class WorkgroupAwareServiceEvaluator implements Evaluator {
User user = (User)authentication.getPrincipal();
String moduleId = "";
if (targetDomainObject instanceof Service<?>) {
Service<?> service = (Service<?>)targetDomainObject;
Module mod = service.getModule();
if (mod != null) {
moduleId = mod.getId();
}
}
// TODO - v master větvi je na toto pomocná třída
for (Module m : Constants.MODULES) {
/*for (Module m : Constants.MODULES) {
if (m.getServiceClass() != null && m.getServiceClass().isAssignableFrom(targetDomainObject.getClass())) {
moduleId = m.getId();
break;
}
}
}*/
Permission appPermission = null;
for (Permission p : Constants.SPECIAL_PERMISSIONS) {

@ -1,9 +1,13 @@
package info.bukova.isspst.services.orders;
import info.bukova.isspst.Constants;
import info.bukova.isspst.Module;
import info.bukova.isspst.data.JoinedItem;
import info.bukova.isspst.data.RequirementItem;
import info.bukova.isspst.data.RequirementState;
import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.reporting.Report;
import info.bukova.isspst.reporting.ReportType;
import info.bukova.isspst.services.AbstractService;
import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService;
@ -55,4 +59,27 @@ public class ApprovedServiceImpl extends AbstractService<JoinedItem> implements
return items;
}
@Override
public Module getModule() {
for (Module m : Constants.MODULES) {
if (m.getId() == Constants.MOD_REQUIREMENTS) {
return m;
}
}
return null;
}
@Override
public List<Report> getReports() {
Report rep = new Report();
rep.setType(ReportType.DYNAMIC);
rep.setName(Constants.DYNAMIC_REPORT_NAME);
List<Report> ret = new ArrayList<Report>();
ret.add(rep);
return ret;
}
}

Loading…
Cancel
Save