Loading ...
Sorry, an error occurred while loading the content.

Fwd: Re: [grails-user] Acegi Best Practise

Expand Messages
  • Ray Tayek
    ... vice-chair http://ocjug.org/
    Message 1 of 1 , Jun 1, 2008
    View Source
    • 0 Attachment
      >X-IronPort: cdptpa-mx02.mail.rr.com 599730954
      >X-RR-Connecting-IP: 63.246.7.187
      >Mailing-List: contact user-help@...; run by ezmlm
      >List-Post: <http://xircles.codehaus.org/manage_email>
      >List-Help: <http://xircles.codehaus.org/manage_email>
      >List-Unsubscribe: <http://xircles.codehaus.org/manage_email>
      >List-Subscribe: <http://xircles.codehaus.org/manage_email>
      >List-Id: <user.grails.codehaus.org>
      >Reply-to: user@...
      >Delivered-To: mailing list user@...
      >From: Burt Beckwith <burt@...>
      >To: user@...
      >Date: Sun, 1 Jun 2008 13:12:39 -0400
      >User-Agent: KMail/1.9.9
      >X-Provags-ID: V01U2FsdGVkX194WLxiFN7hDphBDmkLQQjj+wMSPOo/gCIlLvX
      > F2/SJNxagBroitznEezx4/R/s2RrIJok4QyT52VQ4SxO2IdoqN
      > lSPT8m9E01KCfVXQa37pgh2OrAlloGd
      >Subject: Re: [grails-user] Acegi Best Practise
      >
      >The script doesn't work like the regular view generation script - its only
      >dynamic attributes are the names of the user and role classes. It has the
      >benefit of having working many-to-many management of the user's roles, but
      >does require custom rework if you've added fields to the domain classes.
      >
      >Burt
      >
      >On Sunday 01 June 2008 1:05:01 pm Luke Shannon wrote:
      > > I have been playing with the suggestion made below on adding
      > > properties to the Acegi domain.
      > >
      > > I notice though when I run 'grails generate-manager' all the views
      > > that get generated do not contain the properties I have added (they
      > > just contains the properties originallydefined in the User domain that
      > > the plugin generates).
      > >
      > > Has anyone else seen this? Does this mean I need to manually add these
      > > properties to all the views?
      > >
      > > On Tue, Apr 22, 2008 at 9:59 AM, Burt Beckwith <burt@...>
      >wrote:
      > > > I had similar requirements on my last project (non-Grails). Each User had
      > > > a Customer (but a Company would be very similar wrt the domain model).
      > > >
      > > > Acegi has 2 primary user-defineable pieces, a class implementing the
      > > > UserDetails interface and one implementing the UserDetailsService
      > > > interface. UserDetails contains security-related info (username, roles,
      > > > isExpired, isEnabled, etc.) and UserDetailsService accesses your data
      > > > store to populate and return a UserDetails if the username and password
      > > > are valid.
      > > >
      > > > The Grails plugin does all of this for you and in addition attaches the
      > > > corresponding User domain instance to the UserDetails instance
      > > > (GrailsUser in 0.2.1, GrailsUserImpl in 0.3). GrailsDaoImpl is the
      > > > implementation of UserDetailsService.
      > > >
      > > > Acegi doesn't care about your domain model since it only works with the
      > > > UserDetails object, so you're free to put whatever info you want in the
      > > > User class (and call it whatever you want) such as first and last name,
      > > > address, etc. You'd want to add a many-to-one for the Company in the
      > > > User, so you'd have:
      > > >
      > > > class Company {
      > > > String name
      > > > ...
      > > > }
      > > >
      > > > class User {
      > > > String username
      > > > String firstName
      > > > String lastName
      > > > Company company
      > > > // photo, interests, etc.
      > > > }
      > > >
      > > > Burt
      > > >
      > > > On Tuesday 22 April 2008 8:06:27 am Luke Shannon wrote:
      > > >> What is best practice for integrating Acegi's with application code?
      > > >>
      > > >> Scenario 1: There is a Company object. A company has 1-* User on the
      > > >> application. When someone logs in, we need to know the company they
      > > >> are with.
      > > >>
      > > >> Scenario 2: Users of the application have information like an address,
      > > >> photo, interests, etc. Upon log in, we need to have all this
      > > >> information available. Should these be stored in a separate domain
      > > >> object and that object be associated with a Acegi User or should the
      > > >> Acegi User be extended?
      > > >>
      > > >> In the case where acegi code needs to be extended, it would be great
      > > >> to see some examples/documentation/tips of how Acegi can be configured
      > > >> in Grails to use the new User/Role objects.
      > > >>
      > > >> Thanks!
      > > >>
      > > >> ---------------------------------------------------------------------
      > > >> To unsubscribe from this list, please visit:
      > > >>
      > > >> http://xircles.codehaus.org/manage_email
      > > >
      > > > ---------------------------------------------------------------------
      > > > To unsubscribe from this list, please visit:
      > > >
      > > > http://xircles.codehaus.org/manage_email
      > >
      > > ---------------------------------------------------------------------
      > > To unsubscribe from this list, please visit:
      > >
      > > http://xircles.codehaus.org/manage_email
      >
      >
      >
      >---------------------------------------------------------------------
      >To unsubscribe from this list, please visit:
      >
      > http://xircles.codehaus.org/manage_email

      ---
      vice-chair http://ocjug.org/
    Your message has been successfully submitted and would be delivered to recipients shortly.