fixed relationship issues
This commit is contained in:
@@ -46,8 +46,8 @@ func ensureUserHasAdminRole(ctx context.Context, tx bun.Tx, user *db.User) error
|
||||
return errors.New("admin role not found in database")
|
||||
}
|
||||
|
||||
// Grant admin role (nil grantedBy = system granted)
|
||||
err = db.AssignRole(ctx, tx, user.ID, adminRole.ID, nil)
|
||||
// Grant admin role
|
||||
err = db.AssignRole(ctx, tx, user.ID, adminRole.ID)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "db.AssignRole")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user