kfaraz commented on a change in pull request #11718:
URL: https://github.com/apache/druid/pull/11718#discussion_r722894777
##########
File path:
indexing-service/src/test/java/org/apache/druid/indexing/overlord/http/OverlordResourceTest.java
##########
@@ -116,10 +117,22 @@ public Authorizer getAuthorizer(String name)
@Override
public Access authorize(AuthenticationResult authenticationResult,
Resource resource, Action action)
{
- if (resource.getName().equals("allow")) {
- return new Access(true);
- } else {
- return new Access(false);
+ final String username = authenticationResult.getIdentity();
+ switch (resource.getName()) {
+ case "allow":
+ return new Access(true);
+ case Datasources.WIKIPEDIA:
+ // All users can read wikipedia but only writer can write
+ return new Access(
+ action == Action.READ || Users.WIKI_WRITER.equals(username)
Review comment:
Should we include this for readability? Because the logic would remain
the same.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]