cancel
Showing results for 
Search instead for 
Did you mean: 

Hide Button

dania
Champ in-the-making
Champ in-the-making
hi
plz does anyone know how to hide a button ? i need that only the admin see (add content , create content , create space …) and not the others users
thanks 4  help Smiley Tongue
9 REPLIES 9

nullman
Champ in-the-making
Champ in-the-making
What sort of rights are the users assigned? You should be able to do this by manipulating space users and user/group roles.

By default all spaces inherit their parent's attributes which is "EVERYONE" is a "Consumer" (read rights). This would mean the default user would not have an Add Content or Create option in a space like Company Home, but they would for their own personal Home space (My Home). In "My Home" for my personal account I can see I am assigned "All" roles. This happen by default when I created my user account. To see this go to "My Home" and select the More Actions drop down and then Manage Space Users. You'll notice that "EVERYONE" is a "Consumer" of My Home - meaning they can have read rights to my space, but no creation (content, spaces, etc.) right in my space.

I hope that's helpful.

mabayona
Champ on-the-rise
Champ on-the-rise
You can hide buttons either via roles and permissions or customizing the web client by changing web-client-config-custom.xml. E.g.

         <!– Action for adding content - quick upload –>
         <action-group id="add_content_menu">
             <style>white-space:nowrap</style>
             <action idref="add_adm_content" hide="true" />
         </action-group>
      
         <!– Actions Menu for Create in Browse screen –>
         <action-group id="browse_create_menu" hide="true">
            <action idref="create_content"  hide="true"  />
            <action idref="create_form"  hide="true" />
            <action idref="create_web_form"  hide="true" />     
            <action idref="create_website_wizard"  hide="true" />
            <action idref="create_project"  hide="true" />
            <action idref="create_space"  hide="true" />
            <action idref="create_space_wizard"  hide="true" />
         </action-group>

dania
Champ in-the-making
Champ in-the-making
thanks 4 ur reply
but what im searching that i dont want that someone else than admin could add content even if he has permission more than editor or consumer
what i want exactly that user has all permission but not to see them even if he has this permission
i try to changing web-client-config-custom.xml as he told me mabayona but it didn't work  :cry:  anyway thanks 4 ur help mabayona and nullman

dania
Champ in-the-making
Champ in-the-making
hi
i can't found

<!– Action for adding content - quick upload –>
         <action-group id="add_content_menu">
             <style>white-space:nowrap</style>
             <action idref="add_adm_content" hide="true" />
         </action-group>

in web-client-config-custom.xml
im using alfresco 2.1

mabayona
Champ on-the-rise
Champ on-the-rise
It is not there. But you can add it. As you know, you can add whatever web client configration parameter that you want to modify from the standard ones.

dania
Champ in-the-making
Champ in-the-making
hi again
i try to add as you told me but nothing was changed
should i change something else???
thanks 4 help

hmedia
Champ in-the-making
Champ in-the-making
Hi all,

I have a similar problem. Does anyone see a way to hide action buttons on a per space rule or even better in relation to an aspect?

The background:
I've created a quick checkout action which checks out documents in a predefined user specific space.
I'll avoid direct editing of items in some spaces. Instead of the users have to check out their documents and check in after editing. Unfortunately if they have the choice between the Edit command and the Checkout and Edit in a second step, users definitely will tend to edit directly. But this generates some conflicts and doesn't create versions etc.
Thus the user should see the edit link button in the working copy space only.
The best would be to have an aspect which gives (or hides) the edit link - or more generally an aspect which controls the action group.

Just I have an idea - the action groups can be defined in the web-client-config-custom.xml. For each <config> I can define an evaluator. Is it maybe possible to combine a config actions tag with a node name condition?

Thanks for any suggestion

jurevert
Champ in-the-making
Champ in-the-making
Hi,

Have you find the way to do this ?
I would like hiding a button depending of an aspect but I can't find the good way…

Thanks,

Julien

hoaivan
Champ in-the-making
Champ in-the-making
This is how to do that:

1. add an evalutor to your action:

<action id="youraction">
            <evaluator>org.alfresco.web.action.evaluator.YourEvaluator</evaluator>
2. implement YourEvaluator's logic:
public class YourEvaluator extends BaseActionEvaluator
{
   public boolean evaluate(Node node)
   {
      DictionaryService dd = Repository.getServiceRegistry(
            FacesContext.getCurrentInstance()).getDictionaryService();
      //the logic goes here!
      return dd.isSubClass(node.getType(), ContentModel.TYPE_CONTENT) &&
             ((node.hasPermission(PermissionService.CHECK_OUT) &&
              (node.isLocked() == false &&
               node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false) &&
               node.hasAspect(ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION) == false));
   }
}