Add a security reference for Portlets (someportlet.xreg)with the parent as the 
reference defined in security.xreg .


Please find the example below.

Say for portlet1 only role1 and admin have got all the rights and others does n't have 
any rights.


This is for portlet1 done in portlets.xreg

    <portlet-entry name="Portlet1" hidden="false" type="ref"
        parent="CustomizerVelocity" application="false">

        <security-ref parent="role1-Only"/>

        <meta-info>
            <title>Weather</title>
            <description>Current weather conditions for a city</description>
        </meta-info>
        
<classname>org.apache.jetspeed.portal.portlets.CustomizerVelocityPortlet</classname>
        <category group="Jetspeed">weather</category>
    </portlet-entry>

In security.xreg define the security reference as below.

    <security-entry name="role1-Only">
        <meta-info>
            <title>role1-only</title>
            <description>Full access to user with the manager role.</description>
        </meta-info>
        <access action="*">
            <allow-if role="admin"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:type="java:org.apache.jetspeed.om.registry.base.BaseSecurityAllow"/>
        </access>
        <access action="*">
            <allow-if role="role1"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:type="java:org.apache.jetspeed.om.registry.base.BaseSecurityAllow"/>
        </access>
    </security-entry>




So role1 will have all the access to portlet1.

In the same way you can do for all other portlets by modifying your security.xreg and 
portlet.xreg.


Thanx
Shiva






-----Original Message-----
From: sunil_ps(INT) 
Sent: Thursday, January 30, 2003 12:30 PM
To: 'Jetspeed Users List'
Subject: How to set Security for Portlets ?


Hi,
I have two new roles defined in my application. role1 and role2

I have 4 portlets.
role1 has to access only 1 and 2 portlets.
but role2 has to have access to all 1,2,3,4 portlets. How to sent the roles
for the portlets ?


Regards,
Sunil P S.
Off: 5010261 (extn :2261)
Res: 3329038


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to