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 p_...@volny.cz on 2010/02/04 23:10:33 UTC

Profiling for 'nobody'

Hello,

I am trying to get Jetspeed 2.2.0 to serve different subsites based on
hostname, even when there is no logged-in user.
My aim is to have a differently-themed login page for each subsite, and
for people to be able to browse the different subsites without logging
in.

After reading the subsite documentation, I managed to get a subsite-by-hostname
rule working.
Note: there seem to be 2 errors in the documentation
- the rule has 2 Criterion elements with name="hostname" - the Snapshot
is imported with no error apparent in the logs, or on the screen, but
it is not accepted by Jetspeed. Calling the second Criterion "hostname-2"
works fine.
- the example subsite-by-hostname rule seems to work only for users but
not roles. I changed it to do only navigation,hostname,role,path and
it then worked OK for roles.

My problem is that without logging on, you can't get directed to the
right subsite - even though your URL has the right hostname!

I tried:
Changing the profiler rule for user and role 'guest' - didn't work.
Changing the global default rule for the profiler by Spring bean config
- worked, but only for the admin user, because it's the only *authenticated*
user that has no profiler rule assigned out-of-the-box.

Is there a way to do what I want, or is it simply not intended to be
possible?



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Profiling for 'nobody'

Posted by David Sean Taylor <d....@onehippo.com>.
On Thu, Feb 4, 2010 at 2:10 PM, <p_...@volny.cz> wrote:

> Hello,
>
> I am trying to get Jetspeed 2.2.0 to serve different subsites based on
> hostname, even when there is no logged-in user.
> My aim is to have a differently-themed login page for each subsite, and
> for people to be able to browse the different subsites without logging
> in.
>
> After reading the subsite documentation, I managed to get a
> subsite-by-hostname
> rule working.
> Note: there seem to be 2 errors in the documentation
> - the rule has 2 Criterion elements with name="hostname" - the Snapshot
> is imported with no error apparent in the logs, or on the screen, but
> it is not accepted by Jetspeed. Calling the second Criterion "hostname-2"
> works fine.
> - the example subsite-by-hostname rule seems to work only for users but
> not roles. I changed it to do only navigation,hostname,role,path and
> it then worked OK for roles.
>
> My problem is that without logging on, you can't get directed to the
> right subsite - even though your URL has the right hostname!
>
> I tried:
> Changing the profiler rule for user and role 'guest' - didn't work.
> Changing the global default rule for the profiler by Spring bean config
> - worked, but only for the admin user, because it's the only
> *authenticated*
> user that has no profiler rule assigned out-of-the-box.
>
> Is there a way to do what I want, or is it simply not intended to be
> possible?


I reproduced your case by assigning the same profiling rule to the guest
user as for the "sublocal" user, and providing the same set of pages in the
guest user's home directory under
/__subsite-root/_hostname/localhost/_user/sublocal/
to /__subsite-root/_hostname/localhost/_user/guest/

At first I also thought it was a bug, because as where it worked fine for
the sublocal user, it fails for the guest user, simply returning the
default-page from the / root dir

However, take a look at the folder.metadata found
in /__subsite-root/folder.metadata:

<security-constraints>
    <security-constraint>
      <roles>subsite, subsite2, user</roles>
      <permissions>view</permissions>
    </security-constraint>
  </security-constraints>

try adding "guest" to the <roles>

<security-constraints>
    <security-constraint>
      <roles>subsite, subsite2, user, guest</roles>
      <permissions>view</permissions>
    </security-constraint>
  </security-constraints>

That did the trick for me, let me know how it works for you