Skip to content

Commit

Permalink
Inline api_user_applications_and_permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisroos committed Jan 4, 2024
1 parent 8d16f98 commit 172886c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions app/controllers/api_users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 172886c

Please sign in to comment.