You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.
user ||= user.new# guest userifuser.id == 1#quick hackcan:access,:allelsifcan:read,:domains,[:name,:entries],:user_id=>user.idcan[:read,:update],:domains,[:autoapprove,:use_recaptcha],:user_id=>user.idcan:read,:entries,:domain=>{:user_id=>user.id}cannot:read,:entries,:domaincan:update,:entries,:approved,:domain=>{:user_id=>user.id}end
The error happens in the after_filter at ine 266:
263after_filter(options.slice(:only,:except))do |controller|
264breakifoptions[:if] && !controller.send(options[:if])=>265breakifoptions[:unless] && controller.send(options[:unless])266unlesscontroller.current_ability.fully_authorized?controller.params[:action],controller.params[:controller]267raiseCanCan::InsufficientAuthorizationCheck,"Authorization check is not sufficient for this action. This is probably because you have conditions or attributes defined in Ability and are not checking for them in the action. One way to solve this is adding load_and_authorize_resource to this controller."268end269end
What happens is this: I show a form, where I show a domain and try to update the autoapprove checkbox.
My update method in the controller looks like this:
# :update updates a specific attribute from an object.defupdate@object=@Klass.find(params[:id])@attribute=params[:attribute]@form_element=params[:form_element]@sub_id=params[:sub_id]@update_span=params[:update]send("#{@form_element.to_s}_update",@object,@attribute)@object.saverespond_todo |format|
debuggerformat.js{}endend
So, everything happens up to the rendering. The value is saved to the object nicely.
But when the after_filter kicks in, it throws this InsufficientAuthorizationCheck exception.
Any ideas on why?
The text was updated successfully, but these errors were encountered:
Dear submitter, Since cancan/raynB hasn't been active for more than 6 months and no body else then ryam himself has commit permissions the cancan project is on a stand still.
Since cancan has several issues including missing support for rails 4 cancan is moving forward to cancancan. More details on: #994
If your feel that your pull request or bug is still applicable (and hasn't been merged in to cancan) it would be really appreciated if you would resubmit it to cancancan (https://github.com/cancancommunity/cancancan)
In ability.rb I have:
The error happens in the after_filter at ine 266:
controller.params[:action], controller.params[:controller] = 'update', 'domains'
In the debuuger I fid this:
What happens is this: I show a form, where I show a domain and try to update the autoapprove checkbox.
My update method in the controller looks like this:
So, everything happens up to the rendering. The value is saved to the object nicely.
But when the after_filter kicks in, it throws this InsufficientAuthorizationCheck exception.
Any ideas on why?
The text was updated successfully, but these errors were encountered: