use of net.sourceforge.processdash.team.group.UserFilter in project processdash by dtuma.
the class DirectTimeMemberTrendChartData 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);
EVSchedule schedule = rollup.getSchedule();
series.add(schedule.getPlanTrendChartSeries());
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 subschedule = tl.getSchedule();
String seriesName = nameHelper.get(tl);
maybeAddSeries(subschedule.getActualTimeTrendChartSeries(seriesName));
}
}
use of net.sourceforge.processdash.team.group.UserFilter in project processdash by dtuma.
the class EVReportSettings method checkPersonalDataPermission.
/**
* If a filter is in place, check to see whether it violates a data privacy
* permission. If so, install a "privacy block" group filter.
*
* @param evModel
* the earned value task list, to which any filtering has already
* been applied
* @param permissionID
* the ID of a data privacy permission to check
*/
public void checkPersonalDataPermission(EVTaskListRollup evModel, String permissionID) {
// if no user filter is in place, or if it's already a block, return.
if (userGroupFilter == null || userGroupFilter instanceof UserGroupPrivacyBlock)
return;
// see if the model contains data for only one person. If not, we're OK
String personalDataID = evModel.getPersonalDataID();
if (personalDataID == null)
return;
// if we've been granted permission to see this person's data, we're OK
UserFilter pf = GroupPermission.getGrantedMembers(permissionID);
EVTaskListFilter tlf = new EVTaskListGroupFilter(pf);
if (tlf.include(personalDataID))
return;
// install a data privacy block filter to protect personal data.
userGroupFilter = new UserGroupPrivacyBlock(userGroupFilter);
evModel.applyTaskListFilter(new EVTaskListGroupFilter(userGroupFilter));
}
use of net.sourceforge.processdash.team.group.UserFilter in project processdash by dtuma.
the class TaskScheduleDialog method buildMenuBar.
private JMenuBar buildMenuBar() {
JMenuBar result = new JMenuBar();
boolean rw = canEdit();
// create the File menu
JMenu fileMenu = makeMenu("File");
fileMenu.add(closeAction);
if (rw)
fileMenu.add(saveAction);
result.add(fileMenu);
// If we're in read-write mode, create the Edit menu.
if (rw) {
JMenu editMenu = makeMenu("Edit");
editMenu.add(addTaskAction);
editMenu.add(deleteTaskAction);
editMenu.add(moveUpAction);
editMenu.add(moveDownAction);
editMenu.add(copyTaskInfoAction);
if (!isRollup()) {
editMenu.addSeparator();
editMenu.add(addPeriodAction);
editMenu.add(insertPeriodAction);
editMenu.add(deletePeriodAction);
}
result.add(editMenu);
}
// create the View menu
JMenu viewMenu = makeMenu("View");
viewMenu.add(expandAllAction);
viewMenu.add(chartAction);
viewMenu.add(filteredChartAction);
viewMenu.add(reportAction);
viewMenu.add(weekReportAction);
for (TSAction t : altReportActions) viewMenu.add(t);
viewMenu.add(filteredReportAction);
viewMenu.add(errorAction);
if (Settings.isPersonalMode()) {
viewMenu.addSeparator();
viewMenu.add(showTimeLogAction);
viewMenu.add(showDefectLogAction);
}
viewMenu.addSeparator();
viewMenu.add(JTableColumnVisibilityAction.getForTable(treeTable));
viewMenu.add(new TSAction("Column_Chooser.Reset_Columns") {
public void actionPerformed(ActionEvent e) {
guiPrefs.reset("treeTable", "flatTable");
}
});
if (flatViewAction != null) {
viewMenu.addSeparator();
JCheckBoxMenuItem item = new JCheckBoxMenuItem(flatViewAction);
flatViewAction.installButtonModel(item);
viewMenu.add(item);
} else if (mergedViewAction != null) {
viewMenu.addSeparator();
JCheckBoxMenuItem item = new JCheckBoxMenuItem(mergedViewAction);
mergedViewAction.installButtonModel(item);
viewMenu.add(item);
}
result.add(viewMenu);
// create the Tools menu
if (Settings.isReadWrite()) {
JMenu toolsMenu = makeMenu("Tools");
saveBaselineAction = new BaselineAction("Buttons.Save_Baseline") {
public void actionPerformed(ActionEvent e) {
saveBaseline();
}
};
toolsMenu.add(saveBaselineAction);
manageBaselinesAction = new BaselineAction("Buttons.Manage_Baselines") {
public void actionPerformed(ActionEvent e) {
manageBaselines();
}
};
toolsMenu.add(manageBaselinesAction);
if (rw) {
if (!isCollaborationBlocked()) {
collaborateAction = new TSAction("Buttons.Collaborate") {
public void actionPerformed(ActionEvent e) {
showCollaborationWizard();
}
};
toolsMenu.add(collaborateAction);
}
scheduleOptionsAction = new TSAction("Buttons.Schedule_Options") {
public void actionPerformed(ActionEvent e) {
showOptionsDialog();
}
};
toolsMenu.add(scheduleOptionsAction);
}
result.add(toolsMenu);
}
// create the Help menu
JMenu helpMenu = makeMenu("Help_Menu.Title");
JMenuItem usingTaskSchedule = new JMenuItem(resources.getString("Help_Menu.Using_Item"));
usingTaskSchedule.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
PCSH.displayHelpTopic("UsingTaskSchedule");
}
});
helpMenu.add(usingTaskSchedule);
result.add(helpMenu);
// add a group selector, if applicable
UserGroupManager groupMgr = UserGroupManager.getInstance();
if (isRollup() && groupMgr.isEnabled()) {
UserFilter filter = groupMgr.getGlobalFilter();
groupFilterMenu = new GroupFilterMenu(filter, groupMgr.isIndivFilteringSupported());
//
groupFilterMenu.addGroupChangeListener(new GroupFilterHandler(filter));
result.add(Box.createHorizontalGlue());
result.add(groupFilterMenu);
}
return result;
}
use of net.sourceforge.processdash.team.group.UserFilter 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;
}
use of net.sourceforge.processdash.team.group.UserFilter in project processdash by dtuma.
the class PlanSummaryNameHeader method writeUserGroupIcon.
/** Print text and icon for choosing a user group
*/
private void writeUserGroupIcon(String projectRoot) {
if (!UserGroupManager.getInstance().isFilteringAvailable())
return;
boolean exporting = isExporting();
if (!exporting)
writeHyperlink("selectGroupFilter", getSnippetParams(false, false));
// retrieve information about the filter that is in effect
UserFilter f = UserGroupManagerDash.getInstance().getLocalFilter(projectRoot);
boolean isPrivacyViolation = f instanceof UserGroupPrivacyBlock;
// display an icon to represent this group filter
out.print("<img border='0' src='/Images/userGroup");
if (isPrivacyViolation)
out.print("Privacy");
else if (f instanceof UserGroupMember)
out.print("Member");
out.print(".png' ");
if (isPrivacyViolation)
out.print("title='Group filter blocked to protect data privacy' ");
else if (!exporting)
out.print("title='Filter to group' ");
else if (!UserGroup.isEveryone(f))
out.print("title='Group filter is in effect' ");
out.print("style='margin: 0px 2px 0px 10px; position:relative; top:3px; width:22px; height:22px'>");
if (!exporting)
out.print("</a>");
// display the name of the filter
if (isPrivacyViolation)
out.print("<span style='color:#888; font-weight:normal; text-decoration:line-through'>");
out.print(HTMLUtils.escapeEntities(f.toString()));
if (isPrivacyViolation)
out.print("</span>");
// display form elements to refresh the page as needed
out.print("<input type='hidden' name='[DB_User_Group/Name]!'>");
out.print("<input type='hidden' name='[User_Group/Privacy_Violation]!'>");
}
Aggregations