Merge remote-tracking branch 'upstream/pull/2192'
This commit is contained in:
commit
dbbbd62ef1
8 changed files with 165 additions and 77 deletions
|
@ -16,6 +16,15 @@ class ApiController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def current_ability
|
||||
# Use capabilities from the oauth token if it exists and is a valid access token
|
||||
if Authenticator.new(self, [:token]).allow?
|
||||
ApiAbility.new(nil).merge(ApiCapability.new(current_token))
|
||||
else
|
||||
ApiAbility.new(current_user)
|
||||
end
|
||||
end
|
||||
|
||||
def deny_access(_exception)
|
||||
if current_token
|
||||
set_locale
|
||||
|
|
|
@ -329,12 +329,7 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
|
||||
def current_ability
|
||||
# Use capabilities from the oauth token if it exists and is a valid access token
|
||||
if Authenticator.new(self, [:token]).allow?
|
||||
Ability.new(nil).merge(Capability.new(current_token))
|
||||
else
|
||||
Ability.new(current_user)
|
||||
end
|
||||
Ability.new(current_user)
|
||||
end
|
||||
|
||||
def deny_access(_exception)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue