You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
| Online: | 26 Members of 4510 |
| Forum: Seam Users |
09. Jun 2008, 23:21 CET | Link |
Hi,
I use Seam 2.0.1GA and I found out an incorrect tip in the Seam security chapter: UI security.
I tried using:
<h:commandButton value="Create Rel Pkg" rendered="#{s.hasRole('USER')}"
action="#{packageAdminAction.startCreateReleasePackage}" />
but it always evaluated to false. So I changed it to:
<<h:commandButton value="Create Rel Pkg" rendered="#{identity.hasRole('USER')}"
action="#{packageAdminAction.startCreateReleasePackage}" />
and now it works.
Can someone please confirm this is a bug? The s.hasRole expression is properly processed in @Restrict annotation on component security.
I suggest that the UI usage be made consistent with component security @Restrict usage.
Thanks, -Guillaume
Documentation:
Your code:
Does that answer your question?
Regards,
Siarhei
D'oh, thanks for seeing the obvious. works great with s:hasRole
Now comes the next question, I didn't know you could use semi-colon notation in an EL expression, can somebody tell me what makes it different from the regular dot (.) notation ?
It's often good to know why things are such a way in order to remember it.
Thanks, -Guillaume
I don't think a colon has any special meaning in normal EL but Seam has an own EL-resolver so they are free to use whatever they like. It is probably needed anyway in order to separate it from a normal EL-resolve involving an variable named s.
If a man speaks in the forest and there is no woman around to hear him, is he still wrong?