Skip to content

Commit

Permalink
WIP: Ensure that user has signin permission
Browse files Browse the repository at this point in the history
And that app is not retired.

I am still not sure how much should go in the "scope" vs in the Pundit policy.
  • Loading branch information
chrisroos committed Sep 25, 2023
1 parent f3152be commit f44b8d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/account/signin_permissions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ def create
end

def delete
@application = Doorkeeper::Application.not_retired.find(params[:application_id])
@application = Doorkeeper::Application.can_signin(current_user).find(params[:application_id])

authorize @application, :remove_signin_permission?, policy_class: AccountApplicationsPolicy
end

def destroy
application = Doorkeeper::Application.not_retired.find(params[:application_id])
application = Doorkeeper::Application.can_signin(current_user).find(params[:application_id])

authorize application, :remove_signin_permission?, policy_class: AccountApplicationsPolicy

Expand Down

0 comments on commit f44b8d3

Please sign in to comment.