|
I want a normal user not to be able to modify his dashboard, and i want to make sure he always sees the default dashboard. |
|
|
Dear me, The user dashboard is a document that is automatically copied from the default dashboard defined by the Admin. So you can set any permission you want on this "document". In your case, what you would do, is make sure everyone accesses the default dashboard (not theirs) and give read permission on the default dashboard that is by default restricted to the Administrator. So you need to follow several steps: First Step : always display the default dashboard instead of the user dashboard to StudioAdd an xml contrib to studio so that the defaultdashboard is always displayed instead of the default. Here is the contrib to add in Studio :
Second step : add read permission to the defaultdashboard which is not the case by defaultFor an existing applicationIf the application is already deployed, the permission all already set on the default dashboard so we need to change them. We will need to access it, but this a not an easy access doc :) We will use Nuxeo Shell Go to the adress : yourServer/nuxeo/site/shell (in my case http://localhost:8080/nuxeo/site/shell), it should launch a java applet. Type the following commands :
And then when you access the dashboard from a standard user (after redeploying the Studio project of course), you'll always see the same dashboard, in read-only mode. For a new application (or a reset of the database)The pb with the solution above is that if you redeploy a new database, you will have to redo the permission granting, which is not something you want. So let's use Studio to make sure we add the read permission whenever the defaultDashBoardSpace is created.
Deploy your bundle before anyone accesses the home dashboard on a newly created database and you are (should be) good to go! One more thingThe dashboard cannot be modified by a non admin anymore but you still see the top right buttons for modifying it, it will show errors if you try to :) If you want to remove those buttons, you will have to overidde the xhtml template layout of the page. The file you want to override is : /nuxeo/addons/nuxeo-user-center/nuxeo-user-dashboard/nuxeo-user-dashboard-opensocial/src/main/resources/web/nuxeo.war/incl/dashboard/user_opensocial_dashboard.xhtml (to be updated whith the github link when it's back...) |
|
|
1
Dear you, that's an interesting use case which Laurent could reuse for his blogs ;)
(Sep 11 '12 at 19:04)
Julien Carsique ♦♦
Interesting article/question. I've tried the above Nuxeo shell procedure with a test system and it works, however if I use a development system started under Eclipse there is no defaultDashboeardSpace just an empty container. Any comments?
(Sep 11 '12 at 22:24)
karl_harris
The dashboard is created when accessed for the first time, so It might be the issue here. The other solution is that you only CAP deploy and not DM, if so you should only see a static dashboard, and I don't think the dynamic one is created in that case (did not checked though)
(Sep 12 '12 at 07:41)
Fred Vadon
Hi Fred, what part exactly I have to modify if I want to hidden the buttons: restore default, layout and Add gadget. I found the file user_opensocial_dashboard.xhtml and removed those lines:
but when I check my dashboard, only the button restore default is hidden
(Apr 25 at 15:45)
murkein
Hi, I created another myopensocial_container_template.xhtml file, deleted the lines from insert buttons so I could hide this buttons
(Apr 25 at 16:22)
murkein
|
|