Skip to content

Commit

Permalink
Use name instead of id
Browse files Browse the repository at this point in the history
  • Loading branch information
jerqi committed Jul 11, 2024
1 parent eb73cad commit 58762ec
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ User grantRolesToUser(String metalake, List<String> roles, String user) {
List<Long> roleIds = Lists.newArrayList(toRoleIds(roleEntities));

for (RoleEntity roleEntityToGrant : roleEntitiesToGrant) {
if (roleNames.contains(roleEntityToGrant.name())) {
if (roleIds.contains(roleEntityToGrant.id())) {
LOG.warn(
"Failed to grant, role {} already exists in the user {} of metalake {}",
roleEntityToGrant.name(),
Expand Down Expand Up @@ -142,7 +142,7 @@ Group grantRolesToGroup(String metalake, List<String> roles, String group) {
List<Long> roleIds = Lists.newArrayList(toRoleIds(roleEntities));

for (RoleEntity roleEntityToGrant : roleEntitiesToGrant) {
if (roleNames.contains(roleEntityToGrant.name())) {
if (roleIds.contains(roleEntityToGrant.id())) {
LOG.warn(
"Failed to grant, role {} already exists in the group {} of metalake {}",
roleEntityToGrant.name(),
Expand Down

0 comments on commit 58762ec

Please sign in to comment.