-
1. Re: How to block ALL pages on demand?
cash1981 Jul 19, 2009 11:27 PM (in response to wilczarz.wilczarz.gmail.com)Normally you write
<page view-id="*" required-login="true"> </page>
But in your case you want to match against a certain username. Rare case, because normally you will test against a specific role by using the
s:hasRole('admin')
or you can use the seam permission store. Anyhow, if you want to check against a specific user, you can always say that an action should be performed upon each page like this:
<page view-id="*" > [snip] <action execute="#{someComponent.aTestToSeeWhoIsLoggedIn}/> </page>
And inside that component you can do your check to see if that username is matched.
Please note that I am not 100% sure on the syntax, but this shows how you can do it. You should double check the syntax. -
2. Re: How to block ALL pages on demand?
wilczarz.wilczarz.gmail.com Jul 20, 2009 9:59 AM (in response to wilczarz.wilczarz.gmail.com)Shervin, thanks for reply. Please note that your example is not so different from mine. The page name will be matched against all page nodes from pages.xml and the closest match will be used. If you have <page viewId="*"> and <page viewId="/clients.xhtml"> in pages.xml, and you enter /clients.seam, only the second node will be used. This means that the page action would have to be included in EVERY node in pages.xml, which is exactly what I'm trying to avoid.
Blocking all pages is, of course, a rare case. I use it when I upgrade on test environment, I like to check that everything is ok without being interrupted. Besides if anything goes wrong this would be a clean way to freeze the system.