Added by Jasha Joachimsthal, last edited by Niels van Kampenhout on Jan 23, 2008  (view change) show comment

Labels:

dashboard dashboard Delete
permissions permissions Delete
views views Delete
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

This page describes how to hide the "Users" and "Permission" buttons for certain users. The standard configuration can be overridden in the repository.

This guide uses the default binary download of Hippo Repository, which comes with the 'default' namespace. It could be that you have configured your repository with a different namespace ('default' in this case). You should replace 'default.preview' with 'yournamespace.preview'.

You will have to connect to the Repository via WebDAV. Pick your favorite WebDAV client and proceed with this guide.

  1. Create under the webdav folder 'default.preview' (or your project specific preview folder) a folder called 'configuration' with a subfolder called 'perspectives'.
  2. Create a file called 'component.xml' inside the 'perspectives' folder with the following contents:
    <?xml version="1.0" encoding="UTF-8"?>
    <perspectives id="pm" className="PerspectiveManager">
      <perspective src="cocoon://workbench/repository-configuration/perspectives/dashboard"/>
      <perspective src="cocoon://workbench/standard-configuration/perspectives/search"/>
      <perspective src="cocoon://workbench/standard-configuration/perspectives/documents"/>
      <perspective src="cocoon://workbench/standard-configuration/perspectives/assets"/>
      <perspective src="cocoon://workbench/standard-configuration/perspectives/editing"/>
    </perspectives>
    

    This will configure the CMS to look for the dashboard perspective in the repository.

  3. Copy the folder 'editor/src/site/workbench/standard-configuration/perspectives/dashboard' and its file(s) to 'default.preview/configuration/perspectives'.
  4. Open default.preview/configuration/perspectives/dashboard/component.xml
    The 'component.xml' should look something like:
    <?xml version="1.0"?>
    <perspective  xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
          i18n:attr="label"
          label="topmenu.tab.dashboard"
          width="135"
          id="dashboard" 
          className="DashboardPerspective" 
          frameUrl="/dashboard/perspective.html"
          icon="home"
          container="main">  
        <views id="vm" className="LazyViewManager">
          <view 
             id="welcome"
             label="cms.dashboard.submenu.tab.welcome"
             className="PlainHTMLView"
             appUrl="/dashboard/welcome"
             bootParam=""
             icon="welcome_logo"
             style="welcomeview"/>
          <view
             id="submenu"
             label="SubMenu"
             className="SubMenuView"
             appUrl="/dashboard/submenu"
             bootParam=""
             defaultView="welcome"
             style="submenuview"/>      
          <view
             id="todo"
             label="cms.dashboard.submenu.tab.todo"          
             className="TodoView"
             appUrl="/dashboard/todo"
    	 icon="to-do"          
             bootParam=""
             style="todoview"/>
          <view
             id="userinfo"
             label="cms.dashboard.submenu.tab.userinfo"
             className="UserInfoView"
             appUrl="/slide/admin/views/userinfo"
             icon="photo_portrait"
             bootParam=""
             style="userinfoview"/>
    
          <!-- enable this to be able to put permissions on views from cms -->
          <!--<view src="cocoon://workbench/repository-configuration/perspectives/dashboard/views/dashboardusers"/>-->
    
          <view
             id="dashboardusers"
             label="cms.dashboard.submenu.tab.users"
             className="UsersView"
             appUrl="/slide/admin/views/users"
             editUserUrl="/slide/admin/views/editUser"
             icon="users"          
             bootParam=""
             style="usersview"
             />
              
         <!-- enable this to be able to put permissions on views from cms -->
         <!--<view src="cocoon://workbench/repository-configuration/perspectives/dashboard/views/dashboardpermissions"/>-->
         <view
            id="dashboardpermissions"
            label="cms.dashboard.submenu.tab.permissions"
            className="PermissionsView"
            appUrl="/slide/admin/views/permissions"
            icon="permissions"          
            bootParam="/"
            style="permissionsview"
            />          
         <view
            id="slidefolders"
            label="Folders"
            className="SlideFolderView"
            appUrl="/slide/explorer/tree"
            bootParam="/"
            style="folderview"
            />   
          <view
             id="logout"
             label="cms.dashboard.submenu.tab.logout"
             className="LogOutView"
             appUrl="/dashboard/logout"
             icon="log-out"          
             bootParam=""
             style="logoutview"/> 
         </views>
      </perspective>
    
  5. Create in the 'dashboard' folder inside the repository the file 'views/dashboardusers/component.xml'
  6. Copy the view with id 'dashboardusers' from 'dashboard/component.xml' to 'views/dashboardusers/component.xml'
    The file should look like:
    <view
       id="dashboardusers"
       label="cms.dashboard.submenu.tab.users"
       className="UsersView"
       appUrl="/slide/admin/views/users"
       editUserUrl="/slide/admin/views/editUser"
       icon="users"          
       bootParam=""
       style="usersview"
       />
    
  7. Comment the copied view in 'dashboard/component.xml' and uncomment the line
    <view src="cocoon://workbench/repository-configuration/perspectives/dashboard/views/dashboardusers"/>
    

    This will make the CMS configuration look for the dashboardusers 'compontent.xml' inside the repository.

  8. Create in the 'dashboard' folder the file 'views/dashboardpermissions/component.xml'
  9. Copy the view with id 'dashboardpermissions' from 'dashboard/component.xml' to 'views/dashboardpermissions/component.xml'
    The file should look like this:
    <view
       id="dashboardpermissions"
       label="cms.dashboard.submenu.tab.permissions"
       className="PermissionsView"
       appUrl="/slide/admin/views/permissions"
       icon="permissions"          
       bootParam="/"
       style="permissionsview"
       />
    
  10. Comment the copied view in 'dashboard/component.xml' and uncomment the line
    <view src="cocoon://workbench/repository-configuration/perspectives/dashboard/views/dashboardpermissions"/>
    
  11. From the CMS persmissions interface, deny access to 'views/dashboardusers/component.xml' and 'views/dashboardpermissions/component.xml' for your group or user.

    Be careful not to deny access to the root user (group)

    Your repository tree structure will look like this:
  • default.preview
    • binaries
    • configuration
      • perspectives
        • dashboard
          • views
            • dashboardpermissions
              • component.xml
            • dashboardusers
              • component.xml
          • component.xml
        • component.xml
    • content
    • types

The 'component.xml' inside the repository (located at 'default/files/default.preview/configuration/perspectives/') should look similar to this:

<?xml version="1.0"?>
<perspective  xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
      i18n:attr="label"
      label="topmenu.tab.dashboard"
      width="135"
      id="dashboard" 
      className="DashboardPerspective" 
      frameUrl="/dashboard/perspective.html"
      icon="home"
      container="main">  
    <views id="vm" className="LazyViewManager">
      <view 
         id="welcome"
         label="cms.dashboard.submenu.tab.welcome"
         className="PlainHTMLView"
         appUrl="/dashboard/welcome"
         bootParam=""
         icon="welcome_logo"
         style="welcomeview"/>
      <view
         id="submenu"
         label="SubMenu"
         className="SubMenuView"
         appUrl="/dashboard/submenu"
         bootParam=""
         defaultView="welcome"
         style="submenuview"/>      
      <view
         id="todo"
         label="cms.dashboard.submenu.tab.todo"          
         className="TodoView"
         appUrl="/dashboard/todo"
	 icon="to-do"          
         bootParam=""
         style="todoview"/>
      <view
         id="userinfo"
         label="cms.dashboard.submenu.tab.userinfo"
         className="UserInfoView"
         appUrl="/slide/admin/views/userinfo"
         icon="photo_portrait"
         bootParam=""
         style="userinfoview"/>

     <!-- Two repository enabled views -->

     <view src="cocoon://workbench/repository-configuration/dashboard/views/dashboardusers"/>

     <view src="cocoon://workbench/repository-configuration/dashboard/views/dashboardpermissions"/>

     <view
        id="slidefolders"
        label="Folders"
        className="SlideFolderView"
        appUrl="/slide/explorer/tree"
        bootParam="/"
        style="folderview"
        />   
      <view
         id="logout"
         label="cms.dashboard.submenu.tab.logout"
         className="LogOutView"
         appUrl="/dashboard/logout"
         icon="log-out"          
         bootParam=""
         style="logoutview"/> 
     </views>
  </perspective>