/** * @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); }
/** * @see org.opencms.workplace.tools.A_CmsToolHandler#isEnabled(org.opencms.file.CmsObject) */ @Override public boolean isEnabled(CmsObject cms) { return OpenCms.getRoleManager().hasRole(cms, CmsRole.WORKPLACE_MANAGER); }
/** * @see org.opencms.workplace.tools.A_CmsToolHandler#isVisible(org.opencms.file.CmsObject) */ @Override public boolean isVisible(CmsObject cms) { return OpenCms.getRoleManager().hasRole(cms, CmsRole.WORKPLACE_MANAGER); } }
/** * @see org.opencms.workplace.tools.A_CmsToolHandler#isVisible(org.opencms.file.CmsObject) */ public boolean isVisible(CmsObject cms) { return OpenCms.getRoleManager().hasRole(cms, CmsRole.WORKPLACE_MANAGER); } }
/** * @see org.opencms.workplace.tools.I_CmsToolHandler#isVisible(org.opencms.file.CmsObject) */ public boolean isVisible(CmsObject cms) { return OpenCms.getRoleManager().hasRole(cms, CmsRole.ROOT_ADMIN); } }
/** * Checks if permissions for roles should be editable for the current user on the resource with the given path.<p> * * @param cms the CMS context * @param path the path of a resource * * @return <code>true</code> if permissions for roles should be editable for the current user on the resource with the given path */ public static boolean canEditPermissionsForRoles(CmsObject cms, String path) { return OpenCms.getRoleManager().hasRoleForResource(cms, CmsRole.VFS_MANAGER, path) && path.startsWith(VFS_PATH_SYSTEM); }
/** * @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.EDITOR); }
/** * Initializes this subscription manager with the OpenCms system configuration.<p> * * @param cms an OpenCms context object that must have been initialized with "Admin" permissions * * @throws CmsRoleViolationException in case the given opencms object does not have <code>{@link CmsRole#ROOT_ADMIN}</code> permissions */ public void initialize(CmsObject cms) throws CmsRoleViolationException { OpenCms.getRoleManager().checkRole(cms, CmsRole.ROOT_ADMIN); m_frozen = true; }
/** * @see org.opencms.workplace.tools.I_CmsToolHandler#isVisible(org.opencms.file.CmsObject) */ public boolean isVisible(CmsObject cms) { return OpenCms.getRoleManager().hasRole(cms, CmsRole.ROOT_ADMIN); } }
/** * 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); }
/** * Destroys a session given the session id. Only allowed for users which have the "account manager" role.<p> * * @param cms the current CMS context * @param sessionid the session id * * @throws CmsException if something goes wrong */ public void killSession(CmsObject cms, CmsUUID sessionid) throws CmsException { OpenCms.getRoleManager().checkRole(cms, CmsRole.ACCOUNT_MANAGER); m_sessionStorageProvider.remove(sessionid); }
/** * Add the user to the given role.<p> * * @param user name of the user * @param role name of the role, for example 'EDITOR' * * @throws CmsException if something goes wrong */ public void addUserToRole(String user, String role) throws CmsException { OpenCms.getRoleManager().addUserToRole(m_cms, CmsRole.valueOfRoleName(role), user); }
/** * Returns true if the current user has the "DEVELOPER" role and can view the exception stacktrace.<p> * * @return true if the current user has the "DEVELOPER" role and can view the exception stacktrace */ public boolean showException() { return OpenCms.getRoleManager().hasRole(getCmsObject(), CmsRole.DEVELOPER); }
/** * @see org.opencms.ui.apps.I_CmsWorkplaceAppConfiguration#getVisibility(org.opencms.file.CmsObject) */ @Override public CmsAppVisibilityStatus getVisibility(CmsObject cms) { boolean visible = OpenCms.getRoleManager().hasRole(cms, CmsRole.WORKPLACE_MANAGER); return new CmsAppVisibilityStatus(visible, visible, ""); }
/** * @see org.opencms.workplace.tools.accounts.A_CmsUsersList#getUsers() */ @Override protected List<CmsUser> getUsers() throws CmsException { return CmsPrincipal.filterCoreUsers(OpenCms.getRoleManager().getManageableUsers(getCms(), "", true)); }
/** * @see org.opencms.workplace.tools.accounts.A_CmsGroupsList#getGroups() */ @Override protected List<CmsGroup> getGroups() throws CmsException { return CmsPrincipal.filterCoreGroups(OpenCms.getRoleManager().getManageableGroups(getCms(), "", true)); }
/** * Checks if the current user has the vfs manager role for the current select resource.<p> * * @return <code>true</code> if the current user has the vfs manager role for the current select resource */ private boolean isRoleEditable() { return OpenCms.getRoleManager().hasRoleForResource(getCms(), CmsRole.VFS_MANAGER, getParamResource()) && (getParamResource().startsWith(CmsWorkplace.VFS_PATH_SYSTEM) && getParamResource().startsWith( CmsWorkplace.VFS_PATH_SYSTEM)); } }
/** * 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); }
/** * @see org.opencms.workplace.tools.accounts.A_CmsRoleUsersList#getUsers(boolean) */ @Override protected List<CmsUser> getUsers(boolean withOtherOus) throws CmsException { return OpenCms.getRoleManager().getUsersOfRole( getCms(), CmsRole.valueOf(getCms().readGroup(getParamRole())), withOtherOus, true); }
/** * @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(); } }