some small fixes

This commit is contained in:
Daniel Goc
2026-04-14 14:08:57 +02:00
parent 773e7d3c20
commit 100a9f57d4
4 changed files with 12 additions and 7 deletions

View File

@@ -7,6 +7,7 @@ import (
"time"
"git.ma-al.com/goc_daniel/b2b/app/config"
"git.ma-al.com/goc_daniel/b2b/app/delivery/middleware/perms"
"git.ma-al.com/goc_daniel/b2b/app/model"
"git.ma-al.com/goc_daniel/b2b/app/service/authService"
constdata "git.ma-al.com/goc_daniel/b2b/app/utils/const_data"
@@ -68,7 +69,7 @@ func Authenticate() fiber.Handler {
}
// We now populate the target user
if model.CustomerRole(user.Role.Name) != model.RoleAdmin {
if !userLocale.OriginalUser.HasPermission(perms.Teleport) {
return c.Next()
}

View File

@@ -14,4 +14,5 @@ const (
SearchCreateIndex Permission = "search.create_index"
OrdersViewAll Permission = "orders.view_all"
OrdersModifyAll Permission = "orders.modify_all"
Teleport Permission = "teleport"
)