Assigning Users to Roles

27 views
Skip to first unread message

Bradford Smith

unread,
Jan 23, 2012, 4:00:37 PM1/23/12
to cant...@googlegroups.com
I'm new to authorization in rails.  Would cantango be a good fit for my situation:

1) I need the ability to assign users to roles.  user1 may have rw permissions on Model1, r permissions on Model2.  user2 may have r permissions on Model1 and Model2.
2) This assignment needs to take place in a relational database.
3) I want to make the admin's life easier and allow them to create templates for roles.  So, for example, Model1 rw and Model2 r could be called PermissionSet1 and Model1 r and Model 2 r could be called PermissionSet2.  And the admin could then create user5 with PermissionSet1, and the user would be assigned to all roles defined for PermissionSet1.
4) If user.admin == true, then the user has permissions to everything,
5) User's are assigned to locations.  For example, user1 is assigned to stores store1 and store2.  I only want user1 accessing store1 and store2 data.  Not sure if this is a role issue or if it's just something I need to handle in the application, outside of the roles.

So, can cantango do all of these items?  If so, how would using cantango make this simpler than just using cancan?

Thanks,
Braford

Kristian Mandrup

unread,
Jan 23, 2012, 5:21:43 PM1/23/12
to cant...@googlegroups.com
Your scenario looks pretty simple. Try with cancan first. Perhaps look at my cancan vs cantango wiki to get some ideas ;)

Sent from my iPhone

Reply all
Reply to author
Forward
0 new messages