File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/permission Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 3737import java .util .Objects ;
3838import java .util .Set ;
3939import java .util .function .Predicate ;
40+ import java .util .stream .Stream ;
4041
4142public interface Role {
4243
@@ -344,6 +345,10 @@ static SimpleRole buildFromRoleDescriptor(
344345 }
345346
346347 for (RoleDescriptor .ApplicationResourcePrivileges applicationPrivilege : roleDescriptor .getApplicationPrivileges ()) {
348+ // We don't support concrete privilege names here, only patterns, since these would require looking up the corresponding actions
349+ // from the security index
350+ assert Stream .of (applicationPrivilege .getPrivileges ()).noneMatch (ApplicationPrivilege ::isValidPrivilegeName )
351+ : "building role from static role descriptor with concrete application privilege names is not supported" ;
347352 builder .addApplicationPrivilege (
348353 new ApplicationPrivilege (
349354 applicationPrivilege .getApplication (),
You can’t perform that action at this time.
0 commit comments