Results 1 to 2 of 2
  1. #1
    mpsk2 is offline Member
    Join Date
    Feb 2015
    Posts
    1
    Rep Power
    0

    Default User in many roles

    Hi guys,
    This is my first post on that forum, so I say hi :P

    I want to make user authentification. In my authentification, user gives his password and login and if it is correct he is logged. It sounds simple. But what I want to do, is to restrict his access to some parts of service based on group he belong to. Sounds normal too.
    But the problem is, I want to be there many groups, every groups has its name, description and roles it is assigned to. Roles and groups are many-to-many relationship, so basicly, user <-> role is many to many relationship. How to do that kind of authentification, that user will belong to many roles.

    Lets say I will be using Java 1.8. Java EE 7, JavaServer Faces, Glassfish server with realm authentification and mysql database.

    I have read, you can do it using multi realm authentification or using method isUserInRole, but no idea how to use it. Moreover, as I have read, JDBC realm will see only one role per one user.

    Correct me if I am wrong, and move thread if it is not in correct section.

  2. #2
    sehudson's Avatar
    sehudson is offline Senior Member
    Join Date
    Mar 2010
    Posts
    384
    Rep Power
    10

    Default Re: User in many roles

    You need a combination of configuring a realm within the Glassfish Server, combined with some configuration in the deployment descriptors for your application. Are your users/roles stored in a database?

Similar Threads

  1. JAVA Developer - leading consultancy - multiple roles - UK
    By simon.shobrook@cdicorp.co in forum Jobs Offered
    Replies: 0
    Last Post: 09-12-2011, 11:38 AM
  2. 3 x Java Development roles available in Bristol
    By ITrecruitment in forum Jobs Offered
    Replies: 0
    Last Post: 05-06-2011, 02:39 PM
  3. Replies: 3
    Last Post: 04-01-2011, 09:58 AM
  4. Replies: 0
    Last Post: 08-12-2008, 01:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •