diff --git a/plugin/src/main/java/org/opensearch/ml/model/MLModelGroupManager.java b/plugin/src/main/java/org/opensearch/ml/model/MLModelGroupManager.java index fac5db25c8..52e9e6d2b7 100644 --- a/plugin/src/main/java/org/opensearch/ml/model/MLModelGroupManager.java +++ b/plugin/src/main/java/org/opensearch/ml/model/MLModelGroupManager.java @@ -167,7 +167,7 @@ private void validateRequestForAccessControl(MLRegisterModelGroupInput input, Us if (modelAccessControlHelper.isAdmin(user) && Boolean.TRUE.equals(isAddAllBackendRoles)) { throw new IllegalArgumentException("Admin users cannot add all backend roles to a model group."); } - if (CollectionUtils.isEmpty(user.getBackendRoles())) { + if (!modelAccessControlHelper.isAdmin(user) && CollectionUtils.isEmpty(user.getBackendRoles())) { throw new IllegalArgumentException("You must have at least one backend role to register a restricted model group."); } if (CollectionUtils.isEmpty(input.getBackendRoles()) && !Boolean.TRUE.equals(isAddAllBackendRoles)) {