Skip to content

Commit

Permalink
Adds new scope named public
Browse files Browse the repository at this point in the history
Signed-off-by: Darshit Chanpura <[email protected]>
  • Loading branch information
DarshitChanpura committed Dec 20, 2024
1 parent 8845812 commit 6269d94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
*/
public enum SampleResourceScope implements ResourceAccessScope {

SAMPLE_FULL_ACCESS("sample_full_access");
SAMPLE_FULL_ACCESS("sample_full_access"),

PUBLIC("public");

private final String name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ protected void doExecute(Task task, DeleteResourceRequest request, ActionListene
try (ThreadContext.StoredContext ignore = threadContext.stashContext()) {
deleteResource(request, ActionListener.wrap(deleteResponse -> {
if (deleteResponse.getResult() == DocWriteResponse.Result.NOT_FOUND) {
listener.onFailure(new ResourceNotFoundException("Resource " + request.getResourceId() + " not found"));
listener.onFailure(new ResourceNotFoundException("Resource " + request.getResourceId() + " not found."));
} else {
listener.onResponse(new DeleteResourceResponse("Resource " + request.getResourceId() + " deleted successfully"));
listener.onResponse(new DeleteResourceResponse("Resource " + request.getResourceId() + " deleted successfully."));
}
}, exception -> {
log.error("Failed to delete resource: " + request.getResourceId(), exception);
Expand Down

0 comments on commit 6269d94

Please sign in to comment.