You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by "Aliyar, Nishar" <ni...@schema.de> on 2002/09/02 16:37:50 UTC
Portlets Configuration : Urgent
Hai All,
I wrote a portlet and I wanted to display this portlet only when the admin loged in how I can do this. How is the configuration for the portlet and which files.
Greetings,
Nishar.
///////////////////////////////////////////////////////////////////
public class LdapAdminPortlet extends AbstractPortlet{
public LdapAdminPortlet() {
}
public ConcreteElement getContent(RunData data){
try{
return new StringElement ("test ") ;
}
catch(Exception ee){
Log.info(" exception from LdapAdminPortlet : "+ee);
ee.printStackTrace();
}
return new StringElement ("test ") ;
}
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Portlets Configuration : Urgent
Posted by Paul Spencer <pa...@mindspring.com>.
Nishar,
Use security. The simplest is to set the security-ref="admin-only" in the psml. This will only allow user in with the role admin from viewing the portlet. Another approach it to use PortalAccessController.checkPermission() in you portlet to verify the user is allowed. See org.apache.jetspeed.services.security.PortalAccessController.java and the security proposal, http://cvs.apache.org/viewcvs.cgi/jakarta-jetspeed/proposals/Security.txt?rev=HEAD&content-type=text/vnd.viewcvs-markup
Paul Spencer
Aliyar, Nishar wrote:
>Hai All,
> I wrote a portlet and I wanted to display this portlet only when the admin loged in how I can do this. How is the configuration for the portlet and which files.
>
>Greetings,
>Nishar.
>
>///////////////////////////////////////////////////////////////////
>
>public class LdapAdminPortlet extends AbstractPortlet{
>
> public LdapAdminPortlet() {
> }
>
> public ConcreteElement getContent(RunData data){
>
> try{
>
> return new StringElement ("test ") ;
>
> }
> catch(Exception ee){
>
> Log.info(" exception from LdapAdminPortlet : "+ee);
> ee.printStackTrace();
> }
>
> return new StringElement ("test ") ;
> }
>}
>
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>