fix(clusters): scope cluster pickers to the owning org
Cluster pickers listed every visible cluster, which includes clusters shared with all authenticated users (e.g. the default org's "shared with everyone" clusters). A member of a custom org could then pick another org's cluster for a model deployment or a new worker. Request only the current org's own clusters (mine=true) for: - the model deploy picker (models page), - the deploy-from-model-file picker (model files page), and - the add-worker picker. These resources are owner-scoped on the backend, so the model list and the worker table (including its cluster-name column) only reference own-org clusters. The add-model-file worker cascader is already own-org via the owner-scoped worker list. Platform admin in the "All" view bypasses mine and is scoped instead by the org picker.
This commit is contained in:
@@ -103,8 +103,14 @@ const Workers: React.FC<WorkersProps> = ({ clusterId, source }) => {
|
||||
|
||||
const getClusterList = async () => {
|
||||
try {
|
||||
// Own-org clusters only (mine=true). A worker can only join a cluster
|
||||
// its org owns, so another org's cluster (e.g. the Default org's
|
||||
// "shared with everyone" clusters) must not be offered in the picker.
|
||||
// The worker list is owner-scoped too, so this list also covers every
|
||||
// cluster the table's name column can reference.
|
||||
const params = {
|
||||
page: -1
|
||||
page: -1,
|
||||
mine: true
|
||||
};
|
||||
const items = await fetchClusterList(params);
|
||||
const clusterMap = items?.reduce(
|
||||
|
||||
Reference in New Issue
Block a user