use of net.sourceforge.processdash.ev.EVTaskListGroupFilter in project processdash by dtuma.
the class ScheduleBalancingDialog method showEditorDialog.
@Override
protected Object showEditorDialog(Object value) throws EditingCancelled {
// identify the privacy controls governing visibility of personal hours
UserFilter pf = GroupPermission.getGrantedMembers(EVSchedule.VIEW_INDIV_HOURS_PERMISSION);
if (pf == null) {
showBlockedByPrivacyMessage(true);
return null;
}
privacyFilter = new EVTaskListGroupFilter(pf);
collectScheduleRows();
if (!scheduleRows.isEmpty()) {
buildAndShowGUI();
} else if (rowsWereFiltered) {
showBlockedByPrivacyMessage(false);
}
return null;
}
use of net.sourceforge.processdash.ev.EVTaskListGroupFilter in project processdash by dtuma.
the class EVReport method getEVModel.
private void getEVModel() throws TinyCGIException {
taskListName = settings.getTaskListName();
if (taskListName == null)
throw new TinyCGIException(400, "schedule name missing");
else if (FAKE_MODEL_NAME.equals(taskListName)) {
evModel = null;
return;
}
long now = System.currentTimeMillis();
synchronized (EVReport.class) {
if (drawingChart && (now - lastRecalcTime < MAX_DELAY) && taskListName.equals(lastTaskListName)) {
evModel = lastEVModel.get();
if (evModel != null)
return;
}
}
evModel = EVTaskList.openExisting(taskListName, getDataRepository(), getPSPProperties(), getObjectCache(), // change notification not required
false);
if (evModel == null)
throw new TinyCGIException(404, "Not Found", "No such task/schedule");
UserFilter f = settings.getUserGroupFilter();
if (f != null && !UserGroup.isEveryone(f) && evModel instanceof EVTaskListRollup) {
EVTaskListRollup rollup = (EVTaskListRollup) evModel;
rollup.applyTaskListFilter(new EVTaskListGroupFilter(f));
String permID = (parameters.containsKey(CHARTS_PARAM) ? EVPermissions.PERSONAL_CHARTS : EVPermissions.PERSONAL_REPORT);
settings.checkPersonalDataPermission(rollup, permID);
}
EVDependencyCalculator depCalc = new EVDependencyCalculator(getDataRepository(), getPSPProperties(), getObjectCache());
evModel.setDependencyCalculator(depCalc);
evModel.setTaskLabeler(new DefaultTaskLabeler(getDashboardContext()));
if (settings.getBool(CUSTOMIZE_HIDE_BASELINE))
evModel.disableBaselineData();
evModel.recalc();
synchronized (EVReport.class) {
lastTaskListName = taskListName;
lastRecalcTime = now;
lastEVModel = new WeakReference<EVTaskList>(evModel);
}
}
use of net.sourceforge.processdash.ev.EVTaskListGroupFilter in project processdash by dtuma.
the class TimeRatioMemberTrackingChartData method recalc.
public void recalc() {
clearSeries();
// see if the user has permission to view personal data in this chart
UserFilter f = GroupPermission.getGrantedMembers(permissionID);
if (f == null)
return;
EVTaskListFilter pf = new EVTaskListGroupFilter(f);
MemberChartNameHelper nameHelper = new MemberChartNameHelper(rollup);
for (int i = 0; i < rollup.getSubScheduleCount(); i++) {
EVTaskList tl = rollup.getSubSchedule(i);
String personalDataID = tl.getPersonalDataID();
if (personalDataID != null && !pf.include(personalDataID))
continue;
EVSchedule subsched = tl.getSchedule();
String seriesName = nameHelper.get(tl);
maybeAddSeries(subsched.getTimeRatioTrackingChartSeries(seriesName, maxDataPoints));
}
}
use of net.sourceforge.processdash.ev.EVTaskListGroupFilter in project processdash by dtuma.
the class TaskScheduleDialog method checkPermission.
private boolean checkPermission(AbstractAction a, int row, String permissionID, String resKey) {
// if this is not a rollup in a team dashboard, permissions are OK
if (!isRollup() || !Settings.isTeamMode())
return true;
// get the list of people we can view data for. If null, the current
// user does not have permission to view personal data at all.
UserFilter userFilter = GroupPermission.getGrantedMembers(permissionID);
if (userFilter == null) {
a.putValue(Action.SHORT_DESCRIPTION, resources.getString("Buttons.Filtered_" + resKey + "_Blocked"));
return false;
}
// if the user is allowed to view data for everyone, return true
if (UserGroup.isEveryone(userFilter))
return true;
// find the personal schedule we are asking to view data for.
TreePath path = treeTable.getTree().getPathForRow(row);
if (path.getPathCount() < 2)
return false;
EVTask rootTask = (EVTask) path.getPathComponent(1);
EVTaskList subSchedule = findTaskListWithRoot(model, rootTask);
if (subSchedule == null)
return false;
// see if the current user has permission to view this schedule
EVTaskListGroupFilter filter = new EVTaskListGroupFilter(userFilter);
if (filter.include(subSchedule.getID()))
return true;
// if we don't have permission, display an explanatory tooltip
a.putValue(Action.SHORT_DESCRIPTION, resources.getString("Buttons.Filtered_" + resKey + "_Restricted"));
return false;
}
Aggregations