Gem

18 views
Skip to first unread message

Avi

unread,
Sep 25, 2012, 4:26:50 AM9/25/12
to rubyonra...@googlegroups.com
Hello All,

Is there any gem for Authorising Permission based on users ?
Like Cancan is used for role based authorisation.



Thanks.

KUL KING

unread,
Sep 25, 2012, 4:35:04 AM9/25/12
to rubyonra...@googlegroups.com
You can set permissions for every role using CanCan.


--
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 rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/ZR6N9llpbrwJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Avi

unread,
Sep 25, 2012, 4:40:50 AM9/25/12
to rubyonra...@googlegroups.com
There can be multiple permissions for a single role. How to handle that?

Rajesh reddy

unread,
Sep 25, 2012, 4:44:40 AM9/25/12
to rubyonra...@googlegroups.com
Hi,

Iam using the rolify gem in my project and found it to be very useful check this out http://eppo.github.com/rolify/


Thanks,

Avi

unread,
Sep 25, 2012, 5:00:18 AM9/25/12
to rubyonra...@googlegroups.com
Yes, this makes some sense.
But this is helpful, when you have only one user per role.

Suppose you are an admin. & under Admin there are 5 sub-admins. All sub-admins have different permissions, but role is still the Admin.
Admin need to assign different different permissions to those 5 sub-admins.
I guess this can't be achieved through CanCan because this is a Role-based authorisation.

KUL KING

unread,
Sep 25, 2012, 7:26:34 AM9/25/12
to rubyonra...@googlegroups.com
Can you explain with an example so that I can better solve your problem?

To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/eEPwtY50G_AJ.

KUL KING

unread,
Sep 25, 2012, 7:28:24 AM9/25/12
to rubyonra...@googlegroups.com
The purpose you want to achieve includes a huge number of if conditions. I can give an example but better is that you provide some scenario.

Avi

unread,
Sep 25, 2012, 7:42:37 AM9/25/12
to rubyonra...@googlegroups.com
Thanks for reply.

So here is the requirement :-

I have an Admin (Admin is a role). & under Admin there are 5 users. All users(same role as Admin) have different permissions.
Those users can be differentiated by their permissions to perform tasks.
Admin need to assign different different permissions to those 5 users.
Here implementation of giving permissions to the role Admin is important. How to achieve this?
An User has has_many relationship with Permission.

In CanCan, we can only define role, but not permissions.

KUL KING

unread,
Sep 25, 2012, 8:27:59 AM9/25/12
to rubyonra...@googlegroups.com
You can have 5 different roles with different permissions you want to assign each of the admin.

To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/FmZYDlkVBFUJ.

Avi

unread,
Sep 25, 2012, 8:54:50 AM9/25/12
to rubyonra...@googlegroups.com
Well, as per the requirement, the role is one-  i.e. Admin. But permissions need to be different for admin users.

KUL KING

unread,
Sep 25, 2012, 8:59:34 AM9/25/12
to rubyonra...@googlegroups.com
It doesn't make sense that a role has different permissions. You can create more roles and assign them different permissions. The purpose you are trying to achieve will always require different roles.

To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/A4HWe7a5_kEJ.
Reply all
Reply to author
Forward
0 new messages