SOLR-6736: Fix authorization permissions

This commit is contained in:
Ishan Chattopadhyaya 2017-04-13 17:31:22 +05:30
parent 89f6d170f5
commit 6d948debc6

View File

@ -306,13 +306,15 @@ public class ConfigSetsHandler extends RequestHandlerBase implements PermissionN
@Override @Override
public Name getPermissionName(AuthorizationContext ctx) { public Name getPermissionName(AuthorizationContext ctx) {
switch (ctx.getHttpMethod()) { String a = ctx.getParams().get(ConfigSetParams.ACTION);
case "GET": if (a != null) {
return Name.CONFIG_READ_PERM; ConfigSetAction action = ConfigSetAction.get(a);
case "POST": if (action == ConfigSetAction.CREATE || action == ConfigSetAction.DELETE || action == ConfigSetAction.UPLOAD) {
return Name.CONFIG_EDIT_PERM; return Name.CONFIG_EDIT_PERM;
default: } else if (action == ConfigSetAction.LIST) {
return Name.CONFIG_READ_PERM;
}
}
return null; return null;
} }
}
} }