a few fixes for user teleportation

This commit is contained in:
Daniel Goc
2026-04-03 13:55:57 +02:00
parent af91842b14
commit f6b321b602
5 changed files with 17 additions and 12 deletions

View File

@@ -21,3 +21,11 @@ func GetUserID(c fiber.Ctx) (uint, bool) {
}
return user_locale.User.ID, true
}
func GetOriginalUserRole(c fiber.Ctx) (model.CustomerRole, bool) {
user_locale, ok := c.Locals(constdata.USER_LOCALE).(*model.UserLocale)
if !ok || user_locale.OriginalUser == nil {
return "", false
}
return user_locale.OriginalUser.Role, true
}