cancel
Showing results for 
Search instead for 
Did you mean: 

Disable Upload button in Document Management

croc
Champ in-the-making
Champ in-the-making
Hi,
I want to disable the Upload button and enable it when a user is in the third folder.
e.g if Folder = folder1;
        button.upload.disable.
else if Folder = folder1/folder2/folder3;
       button.upload.enable.

it is like the one in RM, where you can only file in a folder.

Thanks in advance
9 REPLIES 9

soborno
Champ in-the-making
Champ in-the-making
I guess if you do not want anyone to upload at those folders, is because you want them unchange by any means, so why do not put "Consumer" permission to those folders, and then put higer permissions in the third that you like.

Thanks,
Claudio


If this post was helpful, please click Yes on the Post Rating

croc
Champ in-the-making
Champ in-the-making
Thanks very much.

The only problem I had after that was the folder because I didn't want them to be able to create folder on the 3rd level. So when I disable the folder button it was automatically disabling the file button, which I thought it had something to do with the permissions. So I used a diplay:none style if it is not admin, and it worked.

<#if !user.isAdmin>
       <div class="hideable toolbar-hidden DocListTree" style="display: none;">
            <div class="new-folder"><button id="${args.htmlid}-newFolder-button" name="newFolder">${msg("button.new-folder")}</button></div>
            <div class="separator"> </div>
      </div>
</#if>


Please let me know if there is a way to can only disable the New Folder Button and the Upload button still remain enabled.
Thanks a million times.

soborno
Champ in-the-making
Champ in-the-making
I´m not sure if I understand your request, but for what I get of it. You could do this in toolbar.get.html.ftl:
<#if role = "SiteManager">         <div class="hideable toolbar-hidden DocListTree">            <div class="new-folder"><button id="${args.htmlid}-newFolder-button" name="newFolder">${msg("button.new-folder")}</button></div>            <div class="separator"> </div>         </div></#if>         <div class="hideable toolbar-hidden DocListTree">            <div class="file-upload"><button id="${args.htmlid}-fileUpload-button" name="fileUpload">${msg("button.upload")}</button></div>            <div class="separator"> </div>         </div>‍‍‍‍‍‍‍‍‍‍‍
There the button wil appear only to "SiteManager" (or any role you like), and the fileupload remain untouch.

Regards,
Claudio

danielguerra
Champ in-the-making
Champ in-the-making
i am using alfresco 3.4.b and have gotten the

<#if !user.isAdmin> statement to work but I can not get the

<#if role = "SiteManager"> tag to work

I am trying to hide the create folder button for any user that isn't a site manager

makimaki
Champ in-the-making
Champ in-the-making
I also have the same requirement, only that, I need to Disable the "Create Site" link, and enable it to certain ROLES not user/groups.
e.g role = "SiteManager"
Does anyone have solution for this?

mikeh
Star Contributor
Star Contributor
I also have the same requirement, only that, I need to Disable the "Create Site" link, and enable it to certain ROLES not user/groups.
e.g role = "SiteManager"
Does anyone have solution for this?
That would make no sense - the SiteManager role applies to a specific site, but you're trying to control a UI action outside of any site.

Thanks,
Mike

kwilliamsjr
Champ in-the-making
Champ in-the-making
you'll have to modify the documentlibary's toolbar.js and recreate toolbar-min.js in order to get the changes you made to that ftl to render properly. I hope that helps.

-ken

ivan_vazquez
Champ in-the-making
Champ in-the-making
Hi.
I tried the first example, but the button is hidden for all users who are not admin and admin can't see the button neither. It also disables the upload button for admin. Is there any way to control the visibility of the buttons depending on the folder where you're located and the group to which you belong?. Still, it seems an unreliable way to prevent someone perform an action. Is not there some way to prevent a user, or user group, create a folder on a space, but files? Using permissions, for example.

soborno
Champ in-the-making
Champ in-the-making
I have been out for a while, but in alfresco 5 does the "<#if role = "SiteManager">" or similar statements works under share-documentlibrary-config.xml?

Regards,
Claudio