fix(webui): resolve a selected org's workspaces as the caller, wire selection into gateway and harness, and let a member start tasks in the org they selected
This commit is contained in:
1 parent
c3d49cbc6c
commit
4bb473c0b0
12 files changed
+101
-21
No files matched your search
@@ -21,7 +21,10 @@ func (s *Server) selectedOrg(w http.ResponseWriter, r *http.Request, principal a
|
||||
if chosen == "" {
|
||||
return principal, nil
|
||||
}
|
||||
selected, err := principal.Select(r.Context(), org.OrgID(chosen), s.workspaces())
|
||||
// The lookup runs as the caller, so the State Store knows whose
|
||||
// memberships entitle it to the chosen org's workspaces.
|
||||
ctx := org.WithOrg(access.WithPrincipal(r.Context(), principal), principal.Org)
|
||||
selected, err := principal.Select(ctx, org.OrgID(chosen), s.workspaces())
|
||||
if errors.Is(err, access.ErrNotMember) {
|
||||
s.setOrgCookie(w, r, "")
|
||||
return principal, nil
|
||||
|
||||
Reference in new issue
Block a user