Skip to content

Instantly share code, notes, and snippets.

@thedanielhanke
Created August 9, 2012 09:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thedanielhanke/3302673 to your computer and use it in GitHub Desktop.
Save thedanielhanke/3302673 to your computer and use it in GitHub Desktop.
RailsAdmin CanCan AuthorizationAdapter Override for per-Model abilities
module RailsAdmin
module Extensions
module CanCan
class AuthorizationAdapter
private
module ControllerExtension
def current_ability
@current_ability ||= @ability.new(_current_user, self.params["model_name"])
end
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment