This content has been marked as final. 
    
Show                 5 replies
    
- 
        1. Re: how to use @Roles?atao Sep 1, 2007 10:01 AM (in response to mnrz)With @Name and @Role you can define only two components, with the same scope or not: @Name("user") @Scope(SESSION) @Role(name="user2", scope=SESSION)
 There is no such limitations with @Roles@Name("user") @Scope(SESSION) @Roles({ @Role(name="user2", scope=SESSION), @Role(name="user3", scope=SESSION), @Role(name="user4", scope=SESSION), @Role(name="user5", scope=SESSION), })
 The scopes can be differents.
 Then all the "Role" names can be used as the "Name" one.
- 
        2. Re: how to use @Roles?mnrz Sep 1, 2007 11:50 AM (in response to mnrz)ok, I know about it. Assume that we defined those roles, now, in our session beans how we can use it? 
 for example, I have an Authenticator Session bean in which a User instance variable is defined as follows:@Stateless @Name("authenticator") class Authenticator { @Out("currentUser", scope=ScopeType.SESSION) private User user; // rest of the codes.... }
 and in another bean in which I provide a facility to manage other users for administrators as follows:@Name("userManager") @Stateful class UsreManagerAction implements UserManager { private User user; //rest of the codes.... }
 I want to know how do I use those roles in such these beans?
 thanks again
 how can I use
- 
        
- 
        4. Re: how to use @Roles?pmuir Sep 4, 2007 4:39 AM (in response to mnrz)@In(create=true) User user2; etc.
- 
        5. Re: how to use @Roles?mnrz Sep 4, 2007 4:48 AM (in response to mnrz)what simple :) 
 ok so it has an issue only with auto instantiation and not further benefits.
 I thought a great usability for that.
 thank you both for your reply
 
     
    