Hi Enrique,
There is indeed a bug in the merging of action.
When your action is merged with the old one, the category is duplicated
=> this makes the actions registred twice in the category
==> this makes it displayed twice
To solve the problem, when registring your override action just omit the
category, it will work :
<component name="org.nuxeo.ecm.platform.actions.test.enrique">
<require>org.nuxeo.ecm.platform.actions</require>
<extension target="org.nuxeo.ecm.platform.actions.ActionService"
point="actions">
<action id="user_manager" link="#{userManagerActions.viewUsers}"
enabled="true" label="command.manageMembers" order="20">
<filter-id>only_for_manager</filter-id>
</action>
</extension>
</component>
Tiry
Enrique Perez a écrit :
> I solve it, but I think that there will be a easier way to do this. The
> new component disables the user_manager action and then create a new
> action (it's exactly the same than the former, but with different filters):
>
> <extension target="org.nuxeo.ecm.platform.actions.ActionService"
> point="actions">
>
> <action id="user_manager" link="#{userManagerActions.viewUsers}"
> enabled="false" label="command.manageMembers" order="20">
> <category>USER_SERVICES</category>
> <filter id="user_manager">
> <rule grant="false">
> <condition>
> #{userServicesContext.userManagerEnabled}
> </condition>
> </rule>
> </filter>
> </action>
>
> <action id="user_manager_for_administrators"
> link="#{userManagerActions.viewUsers}"
> enabled="true" label="command.manageMembers" order="20">
> <category>USER_SERVICES</category>
> <filter id="user_manager_for_administrators">
> <rule grant="true">
> <condition>#{userSession.administrator}</condition>
> </rule>
> </filter>
> </action>
>
> </extension>
>
> It works fine, but, is there an easier way to do this? Maybe there is an
> option for replacing actions.
>
> Regards.
>
> Enrique Perez escribió:
>
>> Hi all,
>>
>> I want to enable the "Members management" link only for administrators
>> users. So, I create a new component with the following content:
>>
>> <extension target="org.nuxeo.ecm.platform.actions.ActionService"
>> point="actions">
>>
>> <action id="user_manager" link="#{userManagerActions.viewUsers}"
>> enabled="true" label="command.manageMembers" order="20">
>> <category>USER_SERVICES</category>
>> <filter-id>only_for_manager</filter-id>
>> </action>
>>
>> </extension>
>>
>> When I log in with a member user the link doesn't appear, but when I log
>> in with an administrator user the link appear twice. Is there anything
>> wrong in my XML file?
>>
>> Best regards.
>>
>>
>>
>
>
>
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm