Skip to content

Commit

Permalink
Rename to isSharedWithCurrentUser
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Dec 23, 2024
1 parent e280cf2 commit e055847
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
public class DefaultResourceSharingService<T extends Resource> implements ResourceSharingService<T> {

@Override
public void hasResourceBeenSharedWith(String resourceId, ActionListener<Boolean> resourceSharingListener) {
public void isSharedWithCurrentUser(String resourceId, ActionListener<Boolean> resourceSharingListener) {
resourceSharingListener.onResponse(Boolean.TRUE);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
import org.opensearch.core.action.ActionListener;

public interface ResourceSharingService<T extends Resource> {
void hasResourceBeenSharedWith(String resourceId, ActionListener<Boolean> resourceSharingListener);
void isSharedWithCurrentUser(String resourceId, ActionListener<Boolean> resourceSharingListener);
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void onFailure(Exception e) {
}
};

resourceSharingService.hasResourceBeenSharedWith(request.getResourceId(), shareListener);
resourceSharingService.isSharedWithCurrentUser(request.getResourceId(), shareListener);
} catch (IOException e) {
throw new OpenSearchException("Caught exception while loading resources: " + e.getMessage());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void onFailure(Exception e) {
}
};

resourceSharingService.hasResourceBeenSharedWith(hit.getId(), shareListener);
resourceSharingService.isSharedWithCurrentUser(hit.getId(), shareListener);

} catch (IOException e) {
listResourceListener.onFailure(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private boolean hasPermissionsFor(User authenticatedUser, ResourceSharingEntry s
}

@Override
public void hasResourceBeenSharedWith(String resourceId, ActionListener<Boolean> resourceSharingListener) {
public void isSharedWithCurrentUser(String resourceId, ActionListener<Boolean> resourceSharingListener) {
User authenticatedUser = (User) client.threadPool()
.getThreadContext()
.getPersistent(ConfigConstants.OPENDISTRO_SECURITY_AUTHENTICATED_USER);
Expand Down

0 comments on commit e055847

Please sign in to comment.