Closed onordgren closed 9 years ago
I can add a detection for rails-api base controller (ActionController::API
) easily :) For now you can create an initializer like in the CanCan wiki:
# config/initializers/access_granted.rb
ActionController::API.class_eval do
include AccessGranted::Rails::ControllerMethods
end
Great, thanks for the quick response :)
I pushed a 0.2.1
version with that change :boom:
Hi,
What would be the correct approach to use access-granted with the rails-api gem? In rails-api the ActionController::Base is replaced with a scaled-down version so the controller methods won't be applied automatically by access-granted in https://github.com/chaps-io/access-granted/blob/master/lib/access-granted.rb.
Would a solution be to manually include the module like with cancan (https://github.com/ryanb/cancan/wiki/Rails-API-Gem) or is there any cleaner ways to solve this?