sub menu permission

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

sub menu permission

Ahmad Rabab’ah

Hello  Dears,

How I can control in a permission on sub menu?
example : when user login in username : Ahmad in HR component
I want to show to this user specific sub menu not all like (Global Hr Setting) menu I want to hide it for user Ahmad ,
How I can do that?

 

Best Regards,

 

Ahmad Rbab’ah

Java Developer

 

 

 

P.O.Box 3516 Amman, 11821

The Hashemite Kingdom of Jordan

Tel.                     +962 (6) 556 2620

Mob (Jordan).   +962 79 5077915

/biict

@biict

 

 

Reply | Threaded
Open this post in threaded view
|

Re: sub menu permission

Anchit Jindal
Hi Ahmad,

You can control it via permissions. You can create new security group permission and in menus.xml you can add condition to check if user has there permission then you can allow or block that user for view. Example
        <menu-item name="EditProduct" title="${uiLabelMap.EditProduct}">
            <condition>
                <not>
                    <if-has-permission permission="CATALOG_ADMIN_LTD" action="_VIEW"/>
                </not>
            </condition>
            <link target="EditProduct">
                <parameter param-name="productId"/>
            </link>
        </menu-item>

Hope this help..

Regards, Anchit Jindal
Reply | Threaded
Open this post in threaded view
|

Re: sub menu permission

taher
In addition to the great answer from Anchit, I think also there are
different solutions depending on what you want to achieve (maybe hide /
show things, make different structures, etc ..). So here is another idea:

- You create a screen which would hold your menus
- You test for a condition in <action..> to make sure proper security flags
pass
- If the go to <widgets..> or <fail-widgets..> depending on results, one of
them has one menu layout, the other has another one.

I'm sure there are other ideas too.

On Tue, Feb 7, 2017 at 2:16 PM, Anchit Jindal <[hidden email]>
wrote:

> Hi Ahmad,
>
> You can control it via permissions. You can create new security group
> permission and in menus.xml you can add condition to check if user has
> there
> permission then you can allow or block that user for view. Example
>         <menu-item name="EditProduct" title="${uiLabelMap.EditProduct}">
>             <condition>
>                 <not>
>                     <if-has-permission permission="CATALOG_ADMIN_LTD"
> action="_VIEW"/>
>                 </not>
>             </condition>
>             <link target="EditProduct">
>                 <parameter param-name="productId"/>
>             </link>
>         </menu-item>
>
> Hope this help..
>
> Regards, Anchit Jindal
>
>
>
> --
> View this message in context: http://ofbiz.135035.n4.nabble.
> com/sub-menu-permission-tp4702080p4702082.html
> Sent from the OFBiz - Dev mailing list archive at Nabble.com.
>