You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Deepa Priolkar <de...@TechMahindra.com> on 2010/10/11 20:24:27 UTC

Screen Question

I have a basic requirement to show certain sections of a web page only to users of specific role types.  What is the best way of doing that using ofbiz.  Can we include-screen on basis of some role type checks? 
 
Thanks & Regards,
Deepa

Re: Screen Question

Posted by Jacques Le Roux <ja...@les7arts.com>.
Yes, you should look at https://cwiki.apache.org/confluence/display/OFBTECH/OFBiz+security

Jacques

From: "Deepa Priolkar" <de...@TechMahindra.com>
I have a basic requirement to show certain sections of a web page only to users of specific role types.  What is the best way of 
doing that using ofbiz.  Can we include-screen on basis of some role type checks?

Thanks & Regards,
Deepa



Re: Screen Question

Posted by Rene Scheibe <re...@tngtech.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/11/2010 08:24 PM, Deepa Priolkar wrote:
> I have a basic requirement to show certain sections of a web page only to users of specific role types.  What is the best way of doing that using ofbiz.  Can we include-screen on basis of some role type checks? 
>  
> Thanks & Regards,
> Deepa
First have a look at:

http://www.opensourcestrategies.com/ofbiz/security.php
https://cwiki.apache.org/OFBTECH/ofbiz-security.html

For restricting sections of a page see some examples below.

In Freemarker (.ftl files):
(set a "hasPermission" variable in an action script before)

<#if security.hasEntityPermission("SOME_PERMISSION", "_VIEW", session)>
    <form>...</form>
<#else>
   <h3>${uiLabelMap.PagePermissionError}</h3>
</#if>


In Screens:

<screen name="...">
    <section>
        <condition>
            <if-has-permission permission="SOME_PERMISSION" action="_VIEW"/>
        </condition>
        <widgets>
           <include-screen name="SomethingYouWantToShow" location="..."/>
        </widgets>
        <fail-widgets>
            <include-screen name="NoPermission" location="..."/>
        </fail-widgets>
    </section>
</screen>

Cheers,
René
- -- 
René Scheibe * rene.scheibe@tngtech.com
TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterföhring
Geschäftsführer: Henrik Klagges, Gerhard Müller, Christoph Stock
Sitz: Unterföhring * Amtsgericht München * HRB 135082
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyzY8gACgkQUXs9EHvIuCrOUwCeP7BnUeQ+wKzFew4jShaSyHDg
xe8An0K9Ja55uVxtUrtN7rd/UkBZDhsW
=jDlG
-----END PGP SIGNATURE-----