Skip to content

Commit f551cef

Browse files
committed
Revert "Remove role mapping block check (#114223)"
This reverts commit ce07060.
1 parent 0a0a4cb commit f551cef

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleMappingMetadata.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.elasticsearch.cluster.AbstractNamedDiffable;
1313
import org.elasticsearch.cluster.ClusterState;
1414
import org.elasticsearch.cluster.NamedDiff;
15+
import org.elasticsearch.cluster.block.ClusterBlockLevel;
1516
import org.elasticsearch.cluster.metadata.Metadata;
1617
import org.elasticsearch.common.collect.Iterators;
1718
import org.elasticsearch.common.io.stream.StreamInput;
@@ -57,6 +58,7 @@ public final class RoleMappingMetadata extends AbstractNamedDiffable<Metadata.Cu
5758
private static final RoleMappingMetadata EMPTY = new RoleMappingMetadata(Set.of());
5859

5960
public static RoleMappingMetadata getFromClusterState(ClusterState clusterState) {
61+
clusterState.blocks().globalBlockedRaiseException(ClusterBlockLevel.READ);
6062
return clusterState.metadata().custom(RoleMappingMetadata.TYPE, RoleMappingMetadata.EMPTY);
6163
}
6264

0 commit comments

Comments
 (0)