mirror of https://github.com/apache/lucene.git
SOLR-6736: Fix authorization permissions
This commit is contained in:
parent
89f6d170f5
commit
6d948debc6
|
@ -306,13 +306,15 @@ public class ConfigSetsHandler extends RequestHandlerBase implements PermissionN
|
|||
|
||||
@Override
|
||||
public Name getPermissionName(AuthorizationContext ctx) {
|
||||
switch (ctx.getHttpMethod()) {
|
||||
case "GET":
|
||||
return Name.CONFIG_READ_PERM;
|
||||
case "POST":
|
||||
String a = ctx.getParams().get(ConfigSetParams.ACTION);
|
||||
if (a != null) {
|
||||
ConfigSetAction action = ConfigSetAction.get(a);
|
||||
if (action == ConfigSetAction.CREATE || action == ConfigSetAction.DELETE || action == ConfigSetAction.UPLOAD) {
|
||||
return Name.CONFIG_EDIT_PERM;
|
||||
default:
|
||||
} else if (action == ConfigSetAction.LIST) {
|
||||
return Name.CONFIG_READ_PERM;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue