Iterator<CmsGroup> it = getGroups(dbc, readOrganizationalUnit(dbc, role.getOuFqn()), false, false).iterator(); while (it.hasNext()) { CmsGroup group = it.next();
/** * Returns the uuid id for the given id.<p> * * TODO: remove this method as soon as possible * * @param dbc the current database context * @param id the old project id * * @return the new uuid for the given id * * @throws CmsException if something goes wrong */ public CmsUUID getProjectId(CmsDbContext dbc, int id) throws CmsException { Iterator<CmsProject> itProjects = getAllAccessibleProjects( dbc, readOrganizationalUnit(dbc, ""), true).iterator(); while (itProjects.hasNext()) { CmsProject project = itProjects.next(); if (project.getUuid().hashCode() == id) { return project.getUuid(); } } return null; }
/** * Returns the uuid id for the given id.<p> * * TODO: remove this method as soon as possible * * @param dbc the current database context * @param id the old project id * * @return the new uuid for the given id * * @throws CmsException if something goes wrong */ public CmsUUID getProjectId(CmsDbContext dbc, int id) throws CmsException { Iterator itProjects = getAllAccessibleProjects(dbc, readOrganizationalUnit(dbc, ""), true).iterator(); while (itProjects.hasNext()) { CmsProject project = (CmsProject)itProjects.next(); if (project.getUuid().hashCode() == id) { return project.getUuid(); } } return null; }
/** * Enumeration class for the mode parameter in the * {@link CmsDriverManager#readChangedResourcesInsideProject(CmsDbContext, CmsUUID, CmsReadChangedProjectResourceMode)} * method.<p> */ private static class CmsReadChangedProjectResourceMode { /** * Default constructor.<p> */ protected CmsReadChangedProjectResourceMode() { // noop } }
Iterator it = getGroups(dbc, readOrganizationalUnit(dbc, role.getOuFqn()), false, false).iterator(); while (it.hasNext()) { CmsGroup group = (CmsGroup)it.next();
/** * Returns all resources of organizational units for which the current user has * the given role role.<p> * * @param dbc the current database context * @param role the role to check * * @return a list of {@link org.opencms.file.CmsResource} objects * * @throws CmsException if something goes wrong */ protected List<CmsResource> getManageableResources(CmsDbContext dbc, CmsRole role) throws CmsException { CmsOrganizationalUnit ou = m_driverManager.readOrganizationalUnit(dbc, role.getOuFqn()); if (hasRole(dbc, dbc.currentUser(), role)) { return m_driverManager.getResourcesForOrganizationalUnit(dbc, ou); } List<CmsResource> resources = new ArrayList<CmsResource>(); Iterator<CmsOrganizationalUnit> it = m_driverManager.getOrganizationalUnits(dbc, ou, false).iterator(); while (it.hasNext()) { CmsOrganizationalUnit orgUnit = it.next(); resources.addAll(getManageableResources(dbc, role.forOrgUnit(orgUnit.getName()))); } return resources; }
/** * Returns all resources of organizational units for which the current user has * the given role role.<p> * * @param dbc the current database context * @param role the role to check * * @return a list of {@link org.opencms.file.CmsResource} objects * * @throws CmsException if something goes wrong */ protected List getManageableResources(CmsDbContext dbc, CmsRole role) throws CmsException { CmsOrganizationalUnit ou = m_driverManager.readOrganizationalUnit(dbc, role.getOuFqn()); if (hasRole(dbc, dbc.currentUser(), role)) { return m_driverManager.getResourcesForOrganizationalUnit(dbc, ou); } List resources = new ArrayList(); Iterator it = m_driverManager.getOrganizationalUnits(dbc, ou, false).iterator(); while (it.hasNext()) { CmsOrganizationalUnit orgUnit = (CmsOrganizationalUnit)it.next(); resources.addAll(getManageableResources(dbc, role.forOrgUnit(orgUnit.getName()))); } return resources; }
CmsRelation rel = internalReadRelation(rr); try { ous.add(m_driverManager.readOrganizationalUnit( dbc, rel.getSourcePath().substring(CmsUserDriver.ORGUNIT_BASE_FOLDER.length())));
role = role.forOrgUnit(""); CmsOrganizationalUnit ou = readOrganizationalUnit(dbc, ouFqn); List<CmsOrganizationalUnit> orgUnits = new ArrayList<CmsOrganizationalUnit>(); if (m_securityManager.hasRole(dbc, dbc.currentUser(), role)) {
role = role.forOrgUnit(""); CmsOrganizationalUnit ou = readOrganizationalUnit(dbc, ouFqn); List orgUnits = new ArrayList(); if (m_securityManager.hasRole(dbc, dbc.currentUser(), role)) {
try { ous.add( m_driverManager.readOrganizationalUnit( dbc, rel.getSourcePath().substring(CmsUserDriver.ORGUNIT_BASE_FOLDER.length())));
CmsRelation rel = internalReadRelation(res); try { ous.add(m_driverManager.readOrganizationalUnit(dbc, rel.getSourcePath().substring( CmsUserDriver.ORGUNIT_BASE_FOLDER.length()))); } catch (CmsException e) {
continue; CmsOrganizationalUnit ou = readOrganizationalUnit(dbc, project.getOuFqn()); if (manOus.contains(ou)) {
/** * Reads an organizational Unit based on its fully qualified name.<p> * * @param context the current request context * @param ouFqn the fully qualified name of the organizational Unit to be read * * @return the organizational Unit that with the provided fully qualified name * * @throws CmsException if something goes wrong */ public CmsOrganizationalUnit readOrganizationalUnit(CmsRequestContext context, String ouFqn) throws CmsException { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); CmsOrganizationalUnit result = null; try { result = m_driverManager.readOrganizationalUnit(dbc, CmsOrganizationalUnit.removeLeadingSeparator(ouFqn)); } catch (Exception e) { dbc.report(null, Messages.get().container(Messages.ERR_READ_ORGUNIT_1, ouFqn), e); } finally { dbc.clear(); } return result; }
/** * Reads an organizational Unit based on its fully qualified name.<p> * * @param context the current request context * @param ouFqn the fully qualified name of the organizational Unit to be read * * @return the organizational Unit that with the provided fully qualified name * * @throws CmsException if something goes wrong */ public CmsOrganizationalUnit readOrganizationalUnit(CmsRequestContext context, String ouFqn) throws CmsException { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); CmsOrganizationalUnit result = null; try { result = m_driverManager.readOrganizationalUnit(dbc, CmsOrganizationalUnit.removeLeadingSeparator(ouFqn)); } catch (Exception e) { dbc.report(null, Messages.get().container(Messages.ERR_READ_ORGUNIT_1, ouFqn), e); } finally { dbc.clear(); } return result; }
m_driverManager.readOrganizationalUnit(dbc, project.getOuFqn()), false).contains(project); } catch (CmsException e) {
m_driverManager.readOrganizationalUnit(dbc, project.getOuFqn()), false).contains(project); } catch (CmsException e) {
/** * Enumeration class for the mode parameter in the * {@link CmsDriverManager#readChangedResourcesInsideProject(CmsDbContext, CmsUUID, CmsReadChangedProjectResourceMode)} * method.<p> */ private static class CmsReadChangedProjectResourceMode { /** * Default constructor.<p> */ protected CmsReadChangedProjectResourceMode() { // noop } }
readOrganizationalUnit(dbc, CmsOrganizationalUnit.getParentFqn(name));
readOrganizationalUnit(dbc, CmsOrganizationalUnit.getParentFqn(name));