Thanks for the reply. In the example above I'm not sure where the
Admin variable is located? Is that in the User's table as a boolean?

The reason for a roles table is that there will be multiple roles
(Admin, Member, Viewer, Guest) etc...

I tried finding the role model gem but it didn't come up in a Google
Search and I'm curious to learn more, do you have a URL?

Thanks

On Sep 14, 5:02 am, radhames brito <rbri...@gmail.com> wrote:
> with cancan, in your ability model
>
> can :manage , Proyect do |proyect|
> proyect.user = current_user
> end
>
> with this only the proyect's owner is an admin of the proyect
>
> and i suggest you create model with the role model gem, there really is no
> need for a role table.
>
>
>
> On Tue, Sep 14, 2010 at 12:28 AM, nobosh <bhellm...@gmail.com> wrote:
> > Hello... Currently I'm using Devise & CanCan which allows me to create
> > Users with Roles using a (Roles_Users) table.
>
> > That's nice, but what I want is to Have Projects in my app and for
> > each project for a user to possibly have a role like (Admin, Viewer,
> > etc)
>
> > What kind of Model would work for this?
>
> > Models
> > Users
> >  has_many: projects
>
> > Projects
> > ?
>
> > Roles
> > ?
>
> > Users_Roles_Projects (user_id, project_id, role_id)
>
> > What do you think? I'm a newbie and could use the understanding and
> > thinking from you fine experienced folks. Thanks!
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Ruby on Rails: Talk" group.
> > To post to this group, send email to rubyonrails-t...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > rubyonrails-talk+unsubscr...@googlegroups.com<rubyonrails-talk%2Bunsubscrib 
> > e...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to