forked from baron/baron-sso
fix: resolve build errors and fix member count synchronization issues in bulk/org-chart import
This commit is contained in:
@@ -530,7 +530,19 @@ func (h *UserHandler) BulkCreateUsers(c *fiber.Ctx) error {
|
||||
localUser := h.mapToLocalUser(*identity)
|
||||
_ = h.UserRepo.Update(context.Background(), localUser)
|
||||
if h.KetoOutboxRepo != nil {
|
||||
// 1. Sync Role based relationship
|
||||
h.syncKetoRole(context.Background(), localUser.ID, role, "", "", localUser.TenantID)
|
||||
|
||||
// 2. Sync direct membership to the Tenant (for count)
|
||||
if localUser.TenantID != nil && *localUser.TenantID != "" {
|
||||
_ = h.KetoOutboxRepo.Create(context.Background(), &domain.KetoOutbox{
|
||||
Namespace: "Tenant",
|
||||
Object: *localUser.TenantID,
|
||||
Relation: "members",
|
||||
Subject: "User:" + localUser.ID,
|
||||
Action: domain.KetoOutboxActionCreate,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user