/** * Returns all users of organizational units for which the current user has * the {@link CmsRole#ACCOUNT_MANAGER} role.<p> * * @param cms the current cms context * @param ouFqn the fully qualified name of the organizational unit * @param includeSubOus if sub organizational units should be included in the search * * @return a list of {@link org.opencms.file.CmsUser} objects * * @throws CmsException if something goes wrong */ public List<CmsUser> getManageableUsers(CmsObject cms, String ouFqn, boolean includeSubOus) throws CmsException { return getManageableUsers(cms, ouFqn, includeSubOus, false); }
/** * Returns all users of organizational units for which the current user has * the {@link CmsRole#ACCOUNT_MANAGER} role.<p> * * @param cms the current cms context * @param ouFqn the fully qualified name of the organizational unit * @param includeSubOus if sub organizational units should be included in the search * * @return a list of {@link org.opencms.file.CmsUser} objects * * @throws CmsException if something goes wrong */ public List getManageableUsers(CmsObject cms, String ouFqn, boolean includeSubOus) throws CmsException { return getManageableUsers(cms, ouFqn, includeSubOus, false); }
/** * @see org.opencms.workplace.tools.accounts.A_CmsUsersList#getUsers() */ @Override protected List<CmsUser> getUsers() throws CmsException { return CmsPrincipal.filterCoreUsers(OpenCms.getRoleManager().getManageableUsers(getCms(), "", true)); }
List<CmsUser> manageableUsers = new ArrayList<CmsUser>(); try { manageableUsers = OpenCms.getRoleManager().getManageableUsers(getCms(), "", true); } catch (CmsException e) { if (LOG.isErrorEnabled()) {
/** * @see org.opencms.workplace.tools.accounts.A_CmsGroupUsersList#getUsers(boolean) */ @Override protected List<CmsUser> getUsers(boolean withOtherOus) throws CmsException { List<CmsUser> groupusers = getCms().getUsersOfGroup(getParamGroupname(), withOtherOus); List<CmsUser> users; if (withOtherOus) { users = OpenCms.getRoleManager().getManageableUsers(getCms(), "", true); } else { users = OpenCms.getRoleManager().getManageableUsers(getCms(), getParamOufqn(), false); } users.removeAll(groupusers); return users; }
/** * Returns the list of users for selection.<p> * * @return a list of users * * @throws CmsException if womething goes wrong */ protected List<CmsPrincipal> getUsers() throws CmsException { List<CmsPrincipal> ret = new ArrayList<CmsPrincipal>(); if (getParamGroup() != null) { ret.addAll(getCms().getUsersOfGroup(getParamGroup())); } else { ret.addAll(OpenCms.getRoleManager().getManageableUsers(getCms(), "", true)); } if (getParamFlags() != null) { int flags = Integer.parseInt(getParamFlags()); return new ArrayList<CmsPrincipal>(CmsPrincipal.filterFlag(ret, flags)); } return ret; }
/** * Returns the list of users for selection.<p> * * @return a list of users * * @throws CmsException if womething goes wrong */ protected List getUsers() throws CmsException { List ret = new ArrayList(); if (getParamGroup() != null) { ret.addAll(getCms().getUsersOfGroup(getParamGroup())); } else { ret.addAll(OpenCms.getRoleManager().getManageableUsers(getCms(), "", true)); } if (getParamFlags() != null) { int flags = Integer.parseInt(getParamFlags()); return CmsPrincipal.filterFlag(ret, flags); } return ret; }
manageableUsers = OpenCms.getRoleManager().getManageableUsers(getCms(), "", true); } catch (CmsException e) { if (LOG.isErrorEnabled()) {
/** * @see org.opencms.workplace.tools.accounts.A_CmsOrgUnitUsersList#getUsers() */ @Override protected List<CmsUser> getUsers() throws CmsException { @SuppressWarnings("unchecked") List<CmsUser> notOuUsers = (ArrayList<CmsUser>)getJsp().getRequest().getSession().getAttribute( A_CmsOrgUnitUsersList.NOT_ORGUNIT_USERS); if (notOuUsers == null) { List<CmsUser> orgUnitsUser = OpenCms.getOrgUnitManager().getUsers(getCms(), getParamOufqn(), false); List<CmsUser> notOrgUnitUsers = OpenCms.getRoleManager().getManageableUsers(getCms(), "", true); notOrgUnitUsers.removeAll(orgUnitsUser); setNotOuUsers(notOrgUnitUsers); } else { setNotOuUsers(notOuUsers); } return getNotOuUsers(); }
/** * @see org.opencms.workplace.tools.accounts.A_CmsRoleUsersList#getUsers(boolean) */ @Override protected List<CmsUser> getUsers(boolean withOtherOus) throws CmsException { List<CmsUser> roleUsers = OpenCms.getRoleManager().getUsersOfRole( getCms(), CmsRole.valueOf(getCms().readGroup(getParamRole())), withOtherOus, false); List<CmsUser> users; if (withOtherOus) { users = OpenCms.getRoleManager().getManageableUsers(getCms(), "", true); } else { users = OpenCms.getRoleManager().getManageableUsers(getCms(), getParamOufqn(), false); } users.removeAll(roleUsers); return users; }
principals.addAll(OpenCms.getRoleManager().getManageableUsers(getCms(), "", true));
if (includeOtherOus) { principals.addAll(OpenCms.getRoleManager().getManageableUsers(getCms(), "", true));