has_no_role

4 views
Skip to first unread message

Brian Johnson

unread,
Feb 27, 2009, 6:19:18 PM2/27/09
to Rails Authorization Plugin
The behavior of has_no_role seems odd to me. If I type user.has_no_role
('admin'), it deletes the role admin rather than deleting the
RolesUser entry that links user to the role admin. If this is the
intended functionality, it certainly violates the principle of least
surprise as it's caused me some issues.

Tim

unread,
Apr 7, 2009, 5:07:51 PM4/7/09
to Rails Authorization Plugin
I'm pretty sure this is a bug because has_no_role has some code that
explicitly checks that the Role object is empty before removing it. I
forked
the repository, changed the behavior and submitted a patch. The
fix is available at http://github.com/onemorething/rails-authorization-plugin/tree/master,
in case you want to check it out before the patch is accepted.

HTH,
TIm
Reply all
Reply to author
Forward
0 new messages