private Map<Integer, GroupDO> getGroupMap() { checkRefresh(); return groupMap; }
private Map<Integer, List<UserRightDO>> getUserRightMap() { checkRefresh(); return rightMap; }
public Map<Integer, Set<Integer>> getUserGroupIdMap() { checkRefresh(); return userGroupIdMap; }
private Map<Integer, PFUserDO> getUserMap() { checkRefresh(); return userMap; }
public boolean isUserMemberOfAdminGroup(final Integer userId) { checkRefresh(); // adminUsers should only be null in maintenance mode (e. g. if user table isn't readable). return adminUsers != null ? adminUsers.contains(userId) : false; }
public boolean isUserMemberOfFinanceGroup(final Integer userId) { checkRefresh(); // financeUsers should only be null in maintenance mode (e. g. if user table isn't readable). return financeUsers != null ? financeUsers.contains(userId) : false; }
public boolean isUserMemberOfOrgaGroup(final Integer userId) { checkRefresh(); // orgaUsers should only be null in maintenance mode (e. g. if user table isn't readable). return orgaUsers != null ? orgaUsers.contains(userId) : false; }
public boolean isUserMemberOfHRGroup(final Integer userId) { checkRefresh(); return hrUsers != null ? hrUsers.contains(userId) : false; }
public boolean isUserMemberOfProjectAssistant(final Integer userId) { checkRefresh(); // projectAssistants should only be null in maintenance mode (e. g. if user table isn't readable). return projectAssistants != null ? projectAssistants.contains(userId) : false; }
public boolean isUserMemberOfMarketingGroup(final Integer userId) { checkRefresh(); return marketingUsers.contains(userId); }
public boolean isUserMemberOfProjectManagers(final Integer userId) { checkRefresh(); // projectManagers should only be null in maintenance mode (e. g. if user table isn't readable). return projectManagers != null ? projectManagers.contains(userId) : false; }
public boolean isUserMemberOfControllingGroup(final Integer userId) { checkRefresh(); // controllingUsers should only be null in maintenance mode (e. g. if user table isn't readable). return controllingUsers != null ? controllingUsers.contains(userId) : false; }
public boolean isUserMemberOfGroup(final Integer userId, final Integer groupId) { if (groupId == null) { return false; } checkRefresh(); final Set<Integer> groupSet = getUserGroupIdMap().get(userId); return (groupSet != null) ? groupSet.contains(groupId) : false; }
public EmployeeDO getEmployee(final Integer userId) { checkRefresh(); EmployeeDO employee = this.employeeMap.get(userId); if (employee == null) { @SuppressWarnings("unchecked") final List<EmployeeDO> list = (List<EmployeeDO>) this.hibernateTemplate .find("from EmployeeDO e where e.user.id = ?", userId); if (list != null && list.size() > 0) { employee = list.get(0); this.employeeMap.put(userId, employee); } } return employee; }
public synchronized void internalSetAdminUser(final PFUserDO adminUser) { if (UserFilter.isUpdateRequiredFirst() == false) { throw new IllegalStateException( "Can't set admin user internally! This method is only available if system is under maintenance (update required first is true)!"); } checkRefresh(); this.adminUsers.add(adminUser.getId()); }
public boolean isUserMemberOfAtLeastOneGroup(final Integer userId, final Integer... groupIds) { if (groupIds == null) { return false; } checkRefresh(); final Set<Integer> groupSet = getUserGroupIdMap().get(userId); if (groupSet == null) { return false; } for (final Integer groupId : groupIds) { if (groupId == null) { continue; } if (groupSet.contains(groupId) == true) { return true; } } return false; }
/** * Returns a collection of group id's to which the user is assigned to. * * @param user * @return collection if found, otherwise null. */ public Collection<Integer> getUserGroups(final PFUserDO user) { checkRefresh(); return getUserGroupIdMap().get(user.getId()); }
public GroupDO getGroup(final ProjectForgeGroup group) { checkRefresh(); for (final GroupDO g : groupMap.values()) { if (group.equals(g.getName()) == true) { return g; } } return null; }