Ruby on Rails Thursday, December 2, 2010



On Thu, Dec 2, 2010 at 10:38 AM, Joshua Martin <josmar52789@gmail.com> wrote:
According to the wiki.. https://github.com/ryanb/cancan/wiki/Checking-Abilities

I think you may need to change the object that can? is evaluating from the @user variable to the class User like so:

<% if can? :create, User %>

This would allow an admin to create any use regardless  of the account it belongs to and that is not what , he wants.

What i have notice is that cancan is very picky when you specify an action so try using others that have the same effect like  write.

<% if can? :write, @user %>

--
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-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment