Skip to content

Commit

Permalink
fix:admin with no backend role on AOS unable to create restricted mod…
Browse files Browse the repository at this point in the history
…el group (#1188)

Signed-off-by: Bhavana Ramaram <[email protected]>
  • Loading branch information
rbhavna authored Aug 7, 2023
1 parent eb1a72f commit fffec84
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit fffec84

Please sign in to comment.