Results 1 to 4 of 4

Thread: Acegi can't surpport the concepts:role & usergroup?

  1. #1
    Join Date
    Apr 2005
    Posts
    2

    Default Acegi can't surpport the concepts:role & usergroup?

    I am a freshman at Acegi ,I want to know if Acegi can surpport the concepts:role & usergroup. if Acegi can,how to do with it? bye

  2. #2
    Join Date
    Oct 2004
    Posts
    207

    Default

    Simply put, Acegi supports the idea of a Principal and Roles.

    For example...
    You can provide an AuthenticationDoa implementation that implements the loadByUsername(String username) method in a way that aggregates the users roles from groups.

    Basically...
    loadByUsername(String username) is called
    You look up a "User" by the username"
    Get the GrantedAuthorities (roles) for that User
    Get the groups the user belongs to
    Aggregate the roles granted to all the groups the user belongs to
    Combine the roles granted to the user, with the roles granted to the groups
    (mash 'em into a set to eliminate duplicates for example)

    Then return a UserDetails object.
    You can return a new net.sf.acegisecurity.providers.dao.User object if you'd like...

  3. #3
    Join Date
    Apr 2005
    Posts
    2

    Default thanks

    Thanks! Your reply is very userful to me. As a newbie I want to get some example of this article, can you help me?

  4. #4
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    It's just a custom AuthenticationDao implementation. If you just have a think about your table schema to reflect groups, it's easy to iterate over each group and add its corresponding roles to the UserDetails you need to return.

Similar Threads

  1. Replies: 8
    Last Post: Mar 19th, 2008, 11:13 AM
  2. Acegi running fine. Howto add roles, ...
    By ThomasBecker in forum Security
    Replies: 9
    Last Post: Sep 16th, 2007, 08:16 AM
  3. Replies: 9
    Last Post: Sep 5th, 2006, 06:50 AM
  4. Acegi for LDAP
    By vaibhav.gandhi in forum Security
    Replies: 12
    Last Post: Jul 13th, 2005, 12:33 AM
  5. Replies: 4
    Last Post: Nov 2nd, 2004, 02:11 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
  •