You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by SAURABH SINGH <sa...@gmail.com> on 2015/09/17 20:40:01 UTC

Screen Rendering on Menu Permission

Hi All

I want help on screen rendering after applying the menu permission

Problem Statement -
I have one module called budget in which I have 3 menus
1.Inwards
2.Outwords
3.Upload and an user has the permission of only third menu which is
"Upload" so while login with this user the menu will be visible for him is
Upload but the controlled in being called is "main" and on this main the
defined screen is "Inward"

So what i want to do is if the user has the permission of Only this menu
there the screen should render the 3rd menu screen only which is upload
menu.

Please help me if needed i can give more clarification on problem
statement.
-- 




*Thanks & RegardsSAURABH SINGH**Software Engineer*

Re: Screen Rendering on Menu Permission

Posted by gil portenseigne <gi...@nereide.fr>.
Hi Saurabh,

A solution is to customize your main screen to check the permission, and 
include the screen you want following your defined rules :

     <screen name="main">
         <section>
             <condition><!-- set your rules here -->
                 <and>
                     <if-has-permission permission="BUDGET" 
action="_UPLOAD"/>
                     <not><if-has-permission permission="BUDGET" 
action="_OTHER"/></not>
                 </and>
             </condition>
             <widgets>
                 <decorator-screen name="BudgetCommonDecorator" 
location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
                         <include-screen name="Upload" 
location="component://budget/widget/budget/CommonScreens.xml"/>
                     </decorator-section>
                 </decorator-screen>
             </widgets>
             <fail-widgets>
                 <decorator-screen name="BudgetCommonDecorator" 
location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
                         <include-screen name="Inwards" 
location="component://budget/widget/budget/CommonScreens.xml"/>
                     </decorator-section>
                 </decorator-screen>
             </fail-widgets>
         </section>
     </screen>

HTH

Gil

On 17/09/2015 20:40, SAURABH SINGH wrote:
> Hi All
>
> I want help on screen rendering after applying the menu permission
>
> Problem Statement -
> I have one module called budget in which I have 3 menus
> 1.Inwards
> 2.Outwords
> 3.Upload and an user has the permission of only third menu which is
> "Upload" so while login with this user the menu will be visible for him is
> Upload but the controlled in being called is "main" and on this main the
> defined screen is "Inward"
>
> So what i want to do is if the user has the permission of Only this menu
> there the screen should render the 3rd menu screen only which is upload
> menu.
>
> Please help me if needed i can give more clarification on problem
> statement.