Merge ApiCapability class into ApiAbility
This commit is contained in:
parent
e2904daf77
commit
cdce867183
5 changed files with 65 additions and 84 deletions
|
@ -65,9 +65,9 @@ class ApiController < ApplicationController
|
|||
def current_ability
|
||||
# Use capabilities from the oauth token if it exists and is a valid access token
|
||||
if doorkeeper_token&.accessible?
|
||||
ApiAbility.new(nil).merge(ApiCapability.new(doorkeeper_token))
|
||||
ApiAbility.new(doorkeeper_token)
|
||||
else
|
||||
ApiAbility.new(current_user)
|
||||
ApiAbility.new(nil)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue