X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ca5de5b4e01297b07ce3a9db45e908f15f7cda11..0e6d4f18dabf9ccf00567886d8e373dbef1f6966:/app/controllers/api_controller.rb?ds=sidebyside diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index 25e1e3b95..eb59a8a8d 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -300,10 +300,9 @@ class ApiController < ApplicationController # * if authenticated via basic auth all permissions are granted, so the list will contain all permissions. # * unauthenticated users have no permissions, so the list will be empty. def permissions - @permissions = case - when current_token.present? + @permissions = if current_token.present? ClientApplication.all_permissions.select { |p| current_token.read_attribute(p) } - when @user + elsif @user ClientApplication.all_permissions else []