-
1. Re: Page restricted to unauthenticated users ?
sannegrinovero Nov 27, 2008 11:25 AM (in response to guybedo)Did you find out how to do this?
I would like to have the same effect; Using a custom portlet would do the trick, but I would loose the capability to update the welcome pages by using CMS. -
2. Re: Page restricted to unauthenticated users ?
dkrieger Nov 27, 2008 3:09 PM (in response to guybedo)We came across this very same problem. We made modifications to the User Authentication system by setting a "Guest" role when not logged in.
The changes were in the 2.6 branch but changes have been made since then to how authentication is handled. What version of portal are you using? -
3. Re: Page restricted to unauthenticated users ?
sannegrinovero Nov 28, 2008 6:25 AM (in response to guybedo)The changes were in the 2.6 branch but changes have been made since then to how authentication is handled. What version of portal are you using?
I'm using 2.7.0.GA;
are you referring to some patch committed to the 2.6 branch or something you did on your local sources? -
4. Re: Page restricted to unauthenticated users ?
dkrieger Nov 28, 2008 11:29 AM (in response to guybedo)No, local change I made to 2.6. It was sort of a hack so wasn't really worthy of committing. I tried doing the same to the 2.7 code but things have changed a bit so its not working like I'd hoped. If I get it working I'll be happy to share the code.
-
5. Re: Page restricted to unauthenticated users ?
dkrieger Nov 28, 2008 1:03 PM (in response to guybedo)Okay so the same fix did work in 2.7... just missed an important line along the way.
Here is the diff file from the 2.7 svn branch that should add support:
http://codingislife.com/share/jbp/guest/JBossPortalGuestRolePatch.diff
If you don't feel like recompiling I also have the portal-security-lib.jar:
http://codingislife.com/share/jbp/guest/portal-security-lib.jar
With this, the role name "Guest" should be active when a person is not logged in. Here is an example of the deployment xml from portlet-instances.xml:<deployment> <if-exists>overwrite</if-exists> <instance> <instance-id>GuestPortletInstance</instance-id> <portlet-ref>TestPortlet</portlet-ref> <security-constraint> <policy-permission> <action-name>view</action-name> <role-name>Guest</role-name> </policy-permission> </security-constraint> </instance> </deployment>
I didn't try it with page security (as in an -object.xml) but I'd imagine it should work the same. -
6. Re: Page restricted to unauthenticated users ?
psevestre Dec 1, 2008 4:29 PM (in response to guybedo)I had a similar problem, but I've used a different approach.
In my case, I want to keep the page (it's the default page) but some elements should not appear to logged users.
To achieve this, I've used some logic in my layout pages, rendering a given region - or not - based on the return value of request.getRemoteUser().
Something like this:<% if ( request.getRemoteUser() == null ) { %> <p:region regionName='welcomebox' regionID='welcomebox'/> <% } %>
-
7. Re: Page restricted to unauthenticated users ?
sannegrinovero Dec 2, 2008 5:58 AM (in response to guybedo)thanks a lot; I had it done as in psevestre's code, but will definitely try the patch of dkrieger as it permits my users to manage the front page by CMS.
I wonder if this functionality wouldn't be welcome by more users, or if it's not possible because of some spec. A configurable option maybe? -
8. Re: Page restricted to unauthenticated users ?
psevestre Dec 2, 2008 7:00 AM (in response to guybedo)Just a sidenote: using "conditional regions" as I did also supports content management via the admin portal. All you have to do is create multiple regions and, in your layout pages, add the appropriate logic.
The end-user will see all regions, and will be able to add content to them at will. Using sound region names like "anonymous_banner" or "admin_sidebox" is a good idea, too.