mirror of
https://github.com/apache/lucene.git
synced 2025-02-13 13:35:37 +00:00
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
|
@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;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user