Hello, Currently I am working on a app, so far I have User (with devise) which are able to create projects. So, if user1 create project A and project B I want him, to be able to assign user2 with role admin on project A, and user2 with moderator admin on project B. I was thinking in creating a UserRoleProject link table, is it a good idea? Also I intend to use CanCan for the authorisation. Thank you -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/3a0731ae-10ce-4283-9578-49aa1b118e50%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
On Tuesday, July 23, 2013 1:52:23 PM UTC+1, alex wrote:> > Hello, > > Currently I am working on a app, so far I have User (with devise) which > are able to create projects. So, if user1 create project A and project B I > want him, to be able to assign user2 with role admin on project A, and > user2 with moderator role on project B. > I was thinking in creating a UserRoleProject link table, is it a good > idea? Also I intend to use CanCan for the authorisation. > > Thank you >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9edbcbe1-e69e-45d3-9d7a-131e14fd6e55%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Thinking more about this, I realised that I should have the fallowing associations. User has_many Projects, Project belongs_to User, User has_many UserRole, UserRole belongs_to User, Projects has_many UserRole, UserRole belongs_to Project, Role has_many UserRole, UserRole belongs_to Role, is this right? On Tuesday, July 23, 2013 5:11:55 PM UTC+1, alex wrote:> > > > On Tuesday, July 23, 2013 1:52:23 PM UTC+1, alex wrote: >> >> Hello, >> >> Currently I am working on a app, so far I have User (with devise) which >> are able to create projects. So, if user1 create project A and project B I >> want him, to be able to assign user2 with role admin on project A, and >> user2 with moderator role on project B. >> I was thinking in creating a UserRoleProject link table, is it a good >> idea? Also I intend to use CanCan for the authorisation. >> >> Thank you >> >-- ------------------------------ Caroco Ltd, Registered in England and Wales – 06541105 Concorde House, Trinity Park, Solihull, Birmingham, B37 7UQ Internet communications are not secure and therefore Caroco does not accept legal responsibility for the contents of this message. Although Caroco operates anti-virus programs, it does not accept responsibility for any damage whatsoever that is caused by viruses being passed. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/76c6587c-762e-4e00-acd0-0ff3913a9cf3%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
On 24 July 2013 11:30, Alex Simion <alex-O1sarqPxMpvQXOPxS62xeg@public.gmane.org> wrote:> Thinking more about this, I realised that I should have the fallowing > associations. User has_many Projects, Project belongs_to User, User has_many > UserRole, UserRole belongs_to User, Projects has_many UserRole, UserRole > belongs_to Project, Role has_many UserRole, UserRole belongs_to Role, is > this right?That should work, however if you had a role of Creator or Owner then you could also setup the creation through the link table and would not need the direct association between user and projects. Colin> > > On Tuesday, July 23, 2013 5:11:55 PM UTC+1, alex wrote: >> >> >> >> On Tuesday, July 23, 2013 1:52:23 PM UTC+1, alex wrote: >>> >>> Hello, >>> >>> Currently I am working on a app, so far I have User (with devise) which >>> are able to create projects. So, if user1 create project A and project B I >>> want him, to be able to assign user2 with role admin on project A, and user2 >>> with moderator role on project B. >>> I was thinking in creating a UserRoleProject link table, is it a good >>> idea? Also I intend to use CanCan for the authorisation. >>> >>> Thank you > > > ________________________________ > Caroco Ltd, Registered in England and Wales – 06541105 > Concorde House, Trinity Park, Solihull, Birmingham, B37 7UQ > > Internet communications are not secure and therefore Caroco does not accept > legal responsibility for the contents of this message. Although Caroco > operates anti-virus programs, it does not accept responsibility for any > damage whatsoever that is caused by viruses being passed. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/76c6587c-762e-4e00-acd0-0ff3913a9cf3%40googlegroups.com. > > For more options, visit https://groups.google.com/groups/opt_out. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLt9J9R0bbcPdLrSu7%2B5BR0jaWfgTOY32arfixQF7eNx9w%40mail.gmail.com. For more options, visit https://groups.google.com/groups/opt_out.