cancel
Showing results for 
Search instead for 
Did you mean: 

Hide 'New folder' button for a custom role

jgautier
Champ in-the-making
Champ in-the-making
Hi,

I use Alfresco Community 3.4d and I created a custom role on Alfresco Share.
I want to hide the "New Folder" button for this role.

I found the file to modify : "toolbar.lib.ftl" in "documentlibrary/include" but I don't know how to do the test.

I tried :


<#if role != "MyCustomRole">


This doesn't work because "role" is undefined.

So I want to know how I can retrieve the connected user role to do my test in this file ?

Thanx.
2 REPLIES 2

parzgnat
Star Contributor
Star Contributor
The variables that are available in the toolbar.lib.ftl file are determined by the toolbar.lib.js file that lives in the same directory as toolbar.lib.ftl.  Any variable that you see being set on the model object in the toolbar.lib.js file can be used in the toolbar.lib.ftl, (e.g. preferences, actionSet, googleDocsEnabled, etc.).  Unfortunately the ability to create a folder is determined by the permissions set on the parent folder.  In other words, if a user has write permission on the parent folder, "New Folder" button will be enabled.  It's not based on the user's role in the site.

The easiest way for you to handle this without any coding would be to give the users my MyCustomRole read-only access to the parent folder.  If that won't work for you, then you'll have to do some custom coding in the toolbar.lib.js file in order to retrieve the user's role for the site.

jgautier
Champ in-the-making
Champ in-the-making
Thanks !

I add the variables in the JS file and I can use it in the FTL.

I use this link : http://forums.alfresco.com/forum/developer-discussions/web-scripts/web-script-status-500-internal-er...