fix user creation (#411)

This commit is contained in:
Christoph
2025-04-21 15:29:53 +02:00
parent 9354a1d9d3
commit e2966d32ea
2 changed files with 14 additions and 2 deletions

View File

@@ -45,6 +45,14 @@ func SystemAdminContextUserInfo() *ContextUserInfo {
}
}
// LdapSyncContextUserInfo returns a context user info for the LDAP syncer.
func LdapSyncContextUserInfo() *ContextUserInfo {
return &ContextUserInfo{
Id: CtxSystemLdapSyncer,
IsAdmin: true,
}
}
// SetUserInfo sets the user info in the context.
func SetUserInfo(ctx context.Context, info *ContextUserInfo) context.Context {
ctx = context.WithValue(ctx, CtxUserInfo, info)