Skip to content

Commit

Permalink
fix for group-delete fix (#3609)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shivam-nagar23 committed Jul 12, 2023
1 parent 3f2a505 commit e9223a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/user/RoleGroupService.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ func (impl RoleGroupServiceImpl) DeleteRoleGroup(bean *bean.RoleGroup) (bool, er
if err != nil {
impl.logger.Errorw("error in getting all role group role mappings or not found", "err", err)
}
allRolesForGroup, err := impl.roleGroupRepository.GetRolesByGroupCasbinName(model.CasbinName)
allRolesForGroup, err := casbin2.GetRolesForUser(model.CasbinName)
if err != nil {
impl.logger.Errorw("error in getting all roles for groups", "err", err)
}
Expand Down Expand Up @@ -644,7 +644,7 @@ func (impl RoleGroupServiceImpl) DeleteRoleGroup(bean *bean.RoleGroup) (bool, er
}

for _, role := range allRolesForGroup {
flag := casbin2.DeleteRoleForUser(model.CasbinName, role.Role)
flag := casbin2.DeleteRoleForUser(model.CasbinName, role)
if flag == false {
impl.logger.Warnw("unable to delete mapping of group and user in casbin", "user", model.CasbinName, "role", role)
return false, err
Expand Down

0 comments on commit e9223a6

Please sign in to comment.