mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-02 06:51:40 +00:00
Allow custom resource permission for admin controllers
This commit is contained in:
@@ -28,7 +28,11 @@ Spree::Admin::BaseController.class_eval do
|
||||
record = self.class.to_s.sub("Controller", "").underscore.split('/').last.singularize.to_sym
|
||||
end
|
||||
authorize! :admin, record
|
||||
authorize! action, record
|
||||
authorize! resource_authorize_action, record
|
||||
end
|
||||
|
||||
def resource_authorize_action
|
||||
action
|
||||
end
|
||||
|
||||
# This is in Spree::Core::ControllerHelpers::Auth
|
||||
|
||||
Reference in New Issue
Block a user