Make options in header 'admin-only' in Alfresco 4.2d

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2013 11:46 AM
For example the Create Site-option was editable like that in: tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/modules/header/sites.get.html.ftl
Also, to make the Repository button admin-accessible only, you could set "permission=admin" to the right option in: tomcat/webapps/share/WEB-INF/classes/alfresco/share-config.xml
In 4.2d, these don't work anymore and I can't find where I can influence this behaviour.
Setting <legacy-mode-enabled> to 'true', which should make the pre-4.2d way work again, but this made things far worse: the Header bar layout was all wrong.
Hope someone can point me in te right direction!
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-03-2013 12:43 PM
The updates mean that you can control which elements are displayed by modifying the definition for the "HEADER_SITES_MENU" widget, e.g. the JavaScript controller extension just needs to contain:
var sitesMenu = widgetUtils.findObject(model.jsonModel.widgets, "id", "HEADER_SITE_CONFIGURATION_DROPDOWN");if (sitesMenu){ sitesMenu.config.showCreateSite = user.isAdmin;}
This would result in the create site menu item only being displayed if the current user was the admin. You could do similar things for the Recent Sites group, the Useful group, the favourites controls and the site finder menu item.
Regards,
Dave

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2013 05:38 AM
Is there any way to (easily) implement your fix in 4.2d? Is there a commit # available with all the needed changes? So far, I can't find it in the public SVN.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2013 06:11 AM
Regards,
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2013 02:24 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2013 10:10 AM
as 4.2.e is out, which should simplify what I initially wanted, I checked your blogs a second time.
The objective is still the same: hiding the CreateSite-option in the Sites-menu.
First I tried to hide the option for all users. So I created the following files:
tomcat/shared/classes/alfresco/web-extension/site-data/extensions/share-header-extensions.xml
<extension> <modules> <module> <id>Hide Create Site</id> <version>1.0</version> <customizations> <customization> <targetPackageRoot>org.alfresco.share.header</targetPackageRoot> <sourcePackageRoot>test.hide-create-site</sourcePackageRoot> </customization> </customizations> </module> </modules></extension>
tomcat/shared/classes/alfresco/web-extension/site-webscripts/test/hide-create-site/share-header.get.js
// Find the "Sites" menu…var sitesMenu = widgetUtils.findObject(model.jsonModel, "id", "HEADER_SITES_MENU");if (sitesMenu != null){ // Hide the site finder… sitesMenu.config.showCreateSite = false;}
Even though I followed your code examples, this doesn't hide the option for admin or non-admin users. What am I doing wrong?
Only when I set showCreateSite to false in tomcat/webapps/share/js/alfresco/header/AlfSitesMenu-min.js, the option isn't shown anymore.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2013 11:08 AM
Regards,
Dave

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2013 02:43 PM
First I put it in tomcat/webapps/share/WEB-INF/lib/, but after a restart the sitefinder was stll there.
I also tried tomcat/shared/lib/ and tomcat/lib/, but without success.
The My Files link is also still there.
I'm using a fresh install of 4.2.e on Centos 6 x64 with only some small modifcations to some dashlets, but none related to the header. I use a non-admin test user.
Is there any way to check if the jar is active and the files in it are loaded succesfully?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2013 04:27 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2013 05:15 AM
thanks for your suggestion: deploying it via the module deployment page was the solution. I probably didn'd re-read part 1 of you blog, where you mention this.
And I'm not yet very used to deploying new code via that mechanism, as for a long time it has been "placing files + restart = profit".
The good news is that I also found the previous additions I made (based on your code) to hide 'Create Site'.
Thanks for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2013 06:10 AM
Regards,
Dave
