You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-dev@portals.apache.org by Ate Douma <at...@douma.nu> on 2004/12/10 02:24:12 UTC

Portlet specification PLT.20.2 (Security Roles): Clarification Request

After reading the Portlet Specification, and the related and referred Servlet 2.3 Specification
over and over again I still don't fully grasp the intention of the writers concerning declarative security.

My problem is this: should the portlet container allow access to a portlet which has a (valid) security-role-ref
element defined which the Principal requesting access don't have?

Although the Servlet Specification is very clear on this matter (no access), the Portlet Specification only
spends *one* single line on it, delegating to the Servlet Specification for the *definition* of roles:

   "The Portlet Specification shares the same definition as roles of the Servlet Specification
    2.3, SRV.12.4 Section."

So what is the "definition" of roles in the Servlet Specification 2,3 section SRV.12.4 ?
Does it include the first part of the second paragraph:

   "A servlet container enforces declarative or programmatic security for the
    principal associated with an incoming request based on the security attributes of
    the principal. This may happen in either of the following ways:"

or just concerns the second part (right after the previous line) which only talks about how a defined role
restriction is matched to the Principal.

I would say, PLT.3 Relationship with the Servlet Specification, should answer this question, and I think it
does indirectly. But, the word security or role isn't nowhere used there.
Still, I think the intention of the following sections speak for likewise enforcement of declarative role security
as in the Servlet Specification:

   "In order to reuse as much as possible of the existing servlet infrastructure, the Portlet
    Specification leverages functionality provided by the Servlet Specification wherever
    possible. This includes deployment, classloading, web applications, web application
    lifecycle management, session management and request dispatching. Many concepts and
    parts of the Portlet API have been modeled after the Servlet API."

and:

   "PLT.3.2 Relationship Between the Servlet Container and the Portlet Container
    The portlet container is an extension of the servlet container. As such, a portlet container
    can be built on top of an existing servlet container or it may implement all the
    functionality of a servlet container. Regardless of how a portlet container is implemented,
    its runtime environment is assumed to support Servlet Specification 2.3."

I really would like a conclusive answer to my problem: should the container in the above example
forbid access or not (I think and hope: yes).

If the answer is indeed yes, then will Pluto implement (eventually) this requirement, or
should we (the Jetspeed-2 team) implement it ourselves?

If need be, I'm more than willing to provide a patch for Pluto, which I think actually will be quite
simple: just find a match of one of the declared roles using request.isUserInRole().

But, I shouldn't rush to conclusions yet. If anyone from the Pluto team and/or someone from the
Portlet Specification team could clarify this, I would be very grateful.
In the end, we can easily enforce this requirement within Jetspeed-2 itself, but if it is a true
requirement I do think the container should be responsible for enforcement.

Regards,

Ate Douma