/** * @see org.opencms.workplace.explorer.menu.I_CmsMenuItemRule#matches(org.opencms.file.CmsObject, org.opencms.workplace.explorer.CmsResourceUtil[]) */ public boolean matches(CmsObject cms, CmsResourceUtil[] resourceUtil) { return !OpenCms.getRoleManager().hasRole(cms, CmsRole.WORKPLACE_USER); }
/** * Returns all relation types.<p> * * @return a list of {@link CmsRelationType} objects */ public static List<CmsRelationType> getAll() { List<CmsRelationType> all = new ArrayList<CmsRelationType>(Arrays.asList(VALUE_ARRAY)); all.addAll(OpenCms.getResourceManager().getRelationTypes()); return Collections.unmodifiableList(all); }
/** * Returns the system information.<p> * * @return the system information */ public CmsSystemInfo getSystemInfo() { return OpenCms.getSystemInfo(); }
/** * Collects all locales possibly used in the system.<p> * * @return the collection of all locales */ private static Collection<Locale> getAllLocales() { Set<Locale> result = new HashSet<Locale>(); result.addAll(OpenCms.getWorkplaceManager().getLocales()); result.addAll(OpenCms.getLocaleManager().getAvailableLocales()); return result; }
/** * Starts the report.<p> */ public void start() { if (m_writeHtml) { try { m_printStream.println(CmsReport.generatePageStartExtended( OpenCms.initCmsObject(OpenCms.getDefaultUsers().getUserGuest()), OpenCms.getSystemInfo().getDefaultEncoding())); } catch (CmsException e) { // ignore } } }
/** * @see org.opencms.ade.detailpage.I_CmsDetailPageFinder#getAllDetailPages(org.opencms.file.CmsObject, int) */ public Collection<String> getAllDetailPages(CmsObject cms, int resType) throws CmsException { if (!OpenCms.getADEManager().isInitialized()) { return new ArrayList<String>(); } String typeName = OpenCms.getResourceManager().getResourceType(resType).getTypeName(); return OpenCms.getADEManager().getDetailPages(cms, typeName); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#validateParamaters() */ @Override protected void validateParamaters() throws Exception { // test the needed parameters OpenCms.getRoleManager().checkRole(getCms(), CmsRole.ACCOUNT_MANAGER.forOrgUnit(getParamOufqn())); OpenCms.getOrgUnitManager().readOrganizationalUnit(getCms(), m_paramOufqn).getName(); } }
/** * Checks whether a user account can be locked because of inactivity. * * @param cms the CMS context * @param user the user to check * @return true if the user may be locked after being inactive for too long */ public boolean canLockBecauseOfInactivity(CmsObject cms, CmsUser user) { return !user.isManaged() && !user.isWebuser() && !OpenCms.getDefaultUsers().isDefaultUser(user.getName()) && !OpenCms.getRoleManager().hasRole(cms, user.getName(), CmsRole.ROOT_ADMIN); }
/** * Returns <code>true</code> if the current user is allowed * to delete the selected resources.<p> * * @return <code>true</code> if the current user is allowed * to delete the selected resources */ public boolean isCanDelete() { return OpenCms.getWorkplaceManager().getDefaultUserSettings().isAllowBrokenRelations() || OpenCms.getRoleManager().hasRole(getCms(), CmsRole.VFS_MANAGER); }
/** * Constructor with options.<p> * * @param cms the current cms context * @param options the options to use */ public CmsPublish(CmsObject cms, CmsPublishOptions options) { m_cms = cms; m_workplaceLocale = OpenCms.getWorkplaceManager().getWorkplaceLocale(m_cms); m_options = options; }
/** * Gets the admin cmsObject.<p> * * @return Admin cmsObject * * @throws CmsException is something goes wrong */ public CmsObject getCmsAdminObject() throws CmsException { return OpenCms.initCmsObject(m_cmsAdmin); }
/** * Reads the locale for the given resource.<p> * * @param res the locale for the resource */ private void readLocale(CmsResource res) { Locale locale = OpenCms.getLocaleManager().getDefaultLocale(m_cms, res); m_localeCache.put(res, locale); }
/** * Returns a flag indicating if the site is the shared site. * * @return <code>true</code> if the site is the shared site, * or <code>false</code> if it is not the shared site. */ public boolean isSharedSite() { return OpenCms.getSiteManager().getSharedFolder().equals(m_siteRoot + "/"); }
/** * Removes the given resources from the user's publish list.<p> * * @param idsToRemove list of structure ids identifying the resources to be removed * * @throws CmsException if something goes wrong */ public void removeResourcesFromPublishList(Collection<CmsUUID> idsToRemove) throws CmsException { OpenCms.getPublishManager().removeResourceFromUsersPubList(m_cms, idsToRemove); }
/** * Gets all users.<p> * * @return the list of all users * * @throws CmsException if something goes wrong */ private List<CmsUser> getUsers() throws CmsException { List<CmsUser> users = OpenCms.getOrgUnitManager().getUsersWithoutAdditionalInfo(m_cms, "", true); return users; }
/** * Checks if this user is the default guest user.<p> * * @return <code>true</code> if this user is the default guest user */ public boolean isGuestUser() { return OpenCms.getDefaultUsers().isUserGuest(getName()); }
/** * @see org.opencms.workplace.list.A_CmsListDialog#validateParamaters() */ @Override protected void validateParamaters() throws Exception { // test the needed parameters OpenCms.getRoleManager().checkRole(getCms(), CmsRole.ACCOUNT_MANAGER.forOrgUnit(getParamOufqn())); OpenCms.getOrgUnitManager().readOrganizationalUnit(getCms(), m_paramOufqn).getName(); } }
/** * Starts the report.<p> */ public void start() { if (m_writeHtml) { try { m_printStream.println( CmsWorkplace.generatePageStartExtended( OpenCms.initCmsObject(OpenCms.getDefaultUsers().getUserGuest()), OpenCms.getSystemInfo().getDefaultEncoding())); } catch (CmsException e) { // ignore } } }
/** * @see org.opencms.workplace.CmsWorkplace#checkRole() */ @Override protected void checkRole() throws CmsRoleViolationException { // needed since these pages are static exported if (!OpenCms.getDefaultUsers().isUserExport(getCms().getRequestContext().currentUser().getName())) { // only for users that are not the export user OpenCms.getRoleManager().checkRole(getCms(), CmsRole.WORKPLACE_USER); } }
/** * Returns <code>true</code> if the current user is allowed * to publish the selected resources.<p> * * @return <code>true</code> if the current user is allowed * to publish the selected resources */ public boolean isCanPublish() { return OpenCms.getWorkplaceManager().getDefaultUserSettings().isAllowBrokenRelations() || OpenCms.getRoleManager().hasRole(getCms(), CmsRole.VFS_MANAGER); }