-
Notifications
You must be signed in to change notification settings - Fork 896
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14307 from jntullo/enhancement/delete_authentication
delete authentication in provider
- Loading branch information
Showing
2 changed files
with
77 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,18 @@ | ||
module Api | ||
class AuthenticationsController < BaseController | ||
def delete_resource(type, id, _data = {}) | ||
auth = resource_search(id, type, collection_class(:authentications)) | ||
raise "Delete not supported for #{authentication_ident(auth)}" unless auth.respond_to?(:delete_in_provider_queue) | ||
task_id = auth.delete_in_provider_queue | ||
action_result(true, "Deleting #{authentication_ident(auth)}", :task_id => task_id) | ||
rescue => err | ||
action_result(false, err.to_s) | ||
end | ||
|
||
private | ||
|
||
def authentication_ident(auth) | ||
"Authentication id:#{auth.id} name: '#{auth.name}'" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters