I had a fairly complicated mess in a 0.7.5 app for user roles/
permissions.  I ended up adding users belong to a group and groups
have and belong to many permissions.  Then had to cache the
permissions per user to avoid dragging the app performance down the
sewer.  Certainly wasn't pretty but kept me from having to dive into
the user model every time I needed a new role.

So, anyway, it's doable as is...  but yes, a plugin to do that would
be nice :)

On Oct 24, 2:51 am, Gert Thiel <[EMAIL PROTECTED]> wrote:
> That doesn't work for me. A user might have several roles.
>
> And having a bunch of isAuthor, isReviewer booleans would clutter my
> models ;-(
>
> I will consider using role_requirement.
>
> Thanks for your hints, Tom. Since you decided that role based
> permissions don't belong into core Hobo, I will take care of that
> myself.
>
> On Oct 24, 10:43 am, Tom Locke <[EMAIL PROTECTED]> wrote:
>
> > > Tom, I did not intend to offense you. Maybe we're just writing
> > > different applications.
>
> > Heh - no problem : )
>
> > > Did you start programming that plugin yet?
>
> > No, but I don't think you need it. Just add fields to your user model.  
> > e.g. a boolean for each role? Or perhaps a single 'role' field is  
> > enough?
>
> >    fields do
> >      role   enum_string(:administrator, :manager, :reviewer, :author)
> >    end
>
> > Then make tests on that field (or fields) in your permission methods.
>
> > Tom
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to