aspose file tools*
The moose likes JBoss/WildFly and the fly likes EJB 3.0: Defining user roles Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "EJB 3.0: Defining user roles" Watch "EJB 3.0: Defining user roles" New topic
Author

EJB 3.0: Defining user roles

anand tiwari
Greenhorn

Joined: Jun 22, 2007
Posts: 22
Hi, I have a bit of confusion in defining the user roles in an ejb application. I got a sample code from the book 'EJB 3 in action'



My doubt is how to associate the roles 'BIDDER','CSR' AND 'ADMIN' shown above?
I mean where to define the mapping for these roles?

Can someone please help?

Thanks
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30764
    
156

This tends to be application server specific and go in a vendor defined xml file. What app server are you using?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
anand tiwari
Greenhorn

Joined: Jun 22, 2007
Posts: 22
I am using JBoss application server.Can you please tell in which xml file the entires will go if i want to define the user roles??
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30764
    
156

I haven't used JBoss specifically. Let's move this to the JBoss forum where someone is more likely to know.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10210
    
166

Anand,

Which is the login module that you are using with the bean? Each login module has its own way of defining roles. For UserRolesLoginModule, which relies on properties files (users.properties and roles.properties), the roles can be mentioned as below:

roles.properties:
----------------
#username=rolename
myname=ADMIN
someone=BIDDER
otherguy=CSR


where myname, someone, otherguy are the names of the individuals and ADMIN, BIDDER, CSR are the roles.

Here is an good wiki article about UsersRolesLoginModule in JBoss.


[My Blog] [JavaRanch Journal]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB 3.0: Defining user roles