basyx commited on
Commit
6443d7d
·
verified ·
1 Parent(s): 7bc5db1

Map brand kit routes to asset scopes

Browse files
Files changed (1) hide show
  1. app/security/policy.py +7 -0
app/security/policy.py CHANGED
@@ -80,6 +80,13 @@ class ScopePolicy:
80
  if method == "DELETE" or path.endswith("/cancel"):
81
  return "jobs:cancel"
82
  return "jobs:create"
 
 
 
 
 
 
 
83
  if path.startswith("/v1/assets"):
84
  if method == "GET":
85
  return "assets:read"
 
80
  if method == "DELETE" or path.endswith("/cancel"):
81
  return "jobs:cancel"
82
  return "jobs:create"
83
+ # Brand kits are workspace-owned assets; use the established asset scopes.
84
+ if path == "/v1/brand" or path.startswith("/v1/brand/"):
85
+ if method == "GET":
86
+ return "assets:read"
87
+ if method == "DELETE":
88
+ return "assets:delete"
89
+ return "assets:write"
90
  if path.startswith("/v1/assets"):
91
  if method == "GET":
92
  return "assets:read"