diff --git a/app/controllers/api_users_controller.rb b/app/controllers/api_users_controller.rb index 0a98017f6..eeb69e0f2 100644 --- a/app/controllers/api_users_controller.rb +++ b/app/controllers/api_users_controller.rb @@ -22,7 +22,7 @@ def new def edit; end def manage_permissions - @applications_and_permissions = api_user_applications_and_permissions(@api_user) + @applications_and_permissions = zip_permissions(visible_applications(@api_user), @api_user) end def manage_tokens; end @@ -73,10 +73,6 @@ def sanitise(permitted_user_params) ).sanitise end - def api_user_applications_and_permissions(user) - zip_permissions(visible_applications(user), user) - end - def visible_applications(user) api_user_authorised_apps = user.authorisations.not_revoked.pluck(:application_id) Doorkeeper::Application.includes(:supported_permissions).where(id: api_user_authorised_apps)