Add require_config_enabled to Api::V1::BaseController
This commit is contained in:
parent
17434a038a
commit
9d68abd908
1 changed files with 6 additions and 0 deletions
|
@ -39,6 +39,12 @@ class Api::V1::BaseController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def require_config_enabled(config)
|
||||
unless FoodsoftConfig[config]
|
||||
raise Api::Errors::PermissionRequired.new(t('application.controller.error_not_enabled', config: config))
|
||||
end
|
||||
end
|
||||
|
||||
def skip_session
|
||||
request.session_options[:skip] = true
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue