[jboss-user] [JBoss Seam] - Usage of @Restrict annotation with method parameters
rizzojo
do-not-reply at jboss.com
Tue Nov 27 09:12:45 EST 2007
Hi,
I'm investigating Seam and WebBeans authorization aspects.
I've a simple question witch answer is not in the Seam reference guide.
In the Seam v2 reference guide,
http://docs.jboss.com/seam/2.0.0.GA/reference/en/html/security.html#d0e7113
The following example is given:
| @Name("account")
| public class AccountAction {
| @In Account selectedAccount;
| @Restrict("#{s:hasPermission('account','modify',selectedAccount)}")
| public void modify() {
| selectedAccount.modify();
| }
| }
|
The interesting part of this is the use of "selectedAccount" attribute injected by seam.
My question is: is it possible to use a method parameter instead of an attribute ?
Something like this:
| @Name("account")
| public class AccountService {
| @Restrict("#{s:hasPermission('account','modify',selectedAccount)}")
| public void modifyAccount(Account selectedAccount) {
| selectedAccount.modify();
| }
| }
|
Thank you.
John.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4108080#4108080
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4108080
More information about the jboss-user
mailing list