feat: scope articles by brand
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/geo-platform/tenant-api/internal/shared/auth"
|
||||
"github.com/geo-platform/tenant-api/internal/shared/response"
|
||||
)
|
||||
|
||||
func requireCurrentBrandID(ctx context.Context) (int64, error) {
|
||||
if brandID, ok := auth.CurrentBrandIDFromCtx(ctx); ok {
|
||||
return brandID, nil
|
||||
}
|
||||
return 0, response.ErrBadRequest(40033, "brand_context_required", "current brand is required")
|
||||
}
|
||||
Reference in New Issue
Block a user