if (neededForFolder) { res = getCms().readResource(CmsResource.getParentFolder(getParamResource()), CmsResourceFilter.ALL); } else { res = getCms().readResource(getParamResource(), CmsResourceFilter.ALL); hasPermissions = getCms().hasPermissions(res, required, false, CmsResourceFilter.ALL) && (OpenCms.getRoleManager().hasRoleForResource( getCms(), CmsRole.ELEMENT_AUTHOR, getCms().getSitePath(res)) || OpenCms.getRoleManager().hasRoleForResource( getCms(), CmsRole.PROJECT_MANAGER, getCms().getSitePath(res)) || OpenCms.getRoleManager().hasRoleForResource( getCms(), CmsRole.ACCOUNT_MANAGER, getCms().getSitePath(res))); } catch (CmsException e) { getSettings().setErrorMessage(errorMessage);
/** * @see org.opencms.workplace.CmsWorkplace#initMessages() */ @Override protected void initMessages() { initSessionInfo(); super.initMessages(); }
/** * @see org.opencms.workplace.CmsWorkplace#checkLock(String, CmsLockType) */ @Override public void checkLock(String resource, CmsLockType type) throws CmsException { CmsResource res = getCms().readResource(resource, CmsResourceFilter.ALL); CmsLock lock = getCms().getLock(res); if (!lock.isNullLock()) { setParamModified(Boolean.TRUE.toString()); } // for resources with siblings make sure all sibling have at least a // temporary lock if ((res.getSiblingCount() > 1) && (lock.isInherited())) { super.checkLock(resource, CmsLockType.TEMPORARY); } else { super.checkLock(resource, type); } }
/** * Checks that the current user is a workplace user.<p> * * @throws CmsRoleViolationException if the user does not have the required role */ @Override protected void checkRole() throws CmsRoleViolationException { OpenCms.getRoleManager().checkRole(getCms(), CmsRole.EDITOR); }
/** * @see org.opencms.workplace.CmsWorkplace#checkLock(String, CmsLockType) */ @Override public void checkLock(String resource, CmsLockType type) throws CmsException { CmsResource res = getCms().readResource(resource, CmsResourceFilter.ALL); CmsLock lock = getCms().getLock(res); if (!lock.isNullLock()) { setParamModified(Boolean.TRUE.toString()); } // for resources with siblings make sure all sibling have at least a // temporary lock if ((res.getSiblingCount() > 1) && (lock.isInherited())) { super.checkLock(resource, CmsLockType.TEMPORARY); } else { super.checkLock(resource, type); } }