Skip to content

Commit f34a79a

Browse files
committed
fix(FR-2502): allow admin to see all vfolders across projects/domains (#6525)
Resolves #6524 (FR-2502) ## Summary - `AdminVFolderNodeListPage` was restricted to the current domain via `scope_id: domain:${domainName}`, so superadmin could only see folders owned by themselves and not vfolders created by other users - Remove `scope_id` from the admin query (all three `vfolder_nodes` calls: main list, active count, deleted count) so superadmin sees all vfolders across projects/domains - Matches the existing pattern in `AdminComputeSessionListPage` which intentionally omits `scope_id` for the same reason - Drop the now-unused `useCurrentDomainValue` import and `domainName` local ## Stack Depends on #6467 (FR-2476), which adds `permission: read_attribute` to the same queries. The permission fix alone does not make other users' folders visible; removing the domain scope is also required. ## Test plan - [ ] `/admin-data` page shows vfolders owned by other users (across all projects/domains) - [ ] Active and deleted folder tab counts reflect all vfolders - [ ] Existing filters (name/status/type/permission/usage mode) still work ## Verification ``` === Relay: PASS === === Lint: PASS === === Format: PASS === === TypeScript: PASS === === ALL PASS === ```
1 parent 81acb9a commit f34a79a

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

react/src/pages/AdminVFolderNodeListPage.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import DeleteVFolderModal from '../components/DeleteVFolderModal';
1313
import RestoreVFolderModal from '../components/RestoreVFolderModal';
1414
import VFolderNodes, { VFolderNodeInList } from '../components/VFolderNodes';
1515
import { handleRowSelectionChange } from '../helper';
16-
import { useCurrentDomainValue, useSuspendedBackendaiClient } from '../hooks';
16+
import { useSuspendedBackendaiClient } from '../hooks';
1717
import { isDeletedCategory } from './VFolderNodeListPage';
1818
import { useToggle } from 'ahooks';
1919
import { Badge, Button, theme, Tooltip } from 'antd';
@@ -66,7 +66,6 @@ const AdminVFolderNodeListPage: React.FC = (props) => {
6666
const { t } = useTranslation();
6767
const { token } = theme.useToken();
6868
const baiClient = useSuspendedBackendaiClient();
69-
const domainName = useCurrentDomainValue();
7069

7170
const [columnOverrides, setColumnOverrides] = useBAISettingUserState(
7271
'table_column_overrides.AdminVFolderNodeListPage',
@@ -124,6 +123,7 @@ const AdminVFolderNodeListPage: React.FC = (props) => {
124123

125124
const [fetchKey, updateFetchKey] = useUpdatableState('initial-fetch');
126125

126+
// scope_id is intentionally omitted so superadmin sees all vfolders across all projects/domains
127127
const queryVariables: AdminVFolderNodeListPageQuery$variables = {
128128
offset: baiPaginationOption.offset,
129129
first: baiPaginationOption.first,
@@ -139,7 +139,6 @@ const AdminVFolderNodeListPage: React.FC = (props) => {
139139
permission: 'read_attribute',
140140
filterForActiveCount: FILTER_BY_STATUS_CATEGORY['active'],
141141
filterForDeletedCount: FILTER_BY_STATUS_CATEGORY['deleted'],
142-
scope_id: `domain:${domainName}`,
143142
};
144143
const deferredQueryVariables = useDeferredValue(queryVariables);
145144
const deferredFetchKey = useDeferredValue(fetchKey);
@@ -155,15 +154,13 @@ const AdminVFolderNodeListPage: React.FC = (props) => {
155154
$permission: VFolderPermissionValueField
156155
$filterForActiveCount: String
157156
$filterForDeletedCount: String
158-
$scope_id: ScopeField
159157
) {
160158
vfolder_nodes(
161159
offset: $offset
162160
first: $first
163161
filter: $filter
164162
order: $order
165163
permission: $permission
166-
scope_id: $scope_id
167164
) {
168165
edges @required(action: THROW) {
169166
node @required(action: THROW) {
@@ -186,7 +183,6 @@ const AdminVFolderNodeListPage: React.FC = (props) => {
186183
offset: 0
187184
filter: $filterForActiveCount
188185
permission: $permission
189-
scope_id: $scope_id
190186
) {
191187
count
192188
}
@@ -195,7 +191,6 @@ const AdminVFolderNodeListPage: React.FC = (props) => {
195191
offset: 0
196192
filter: $filterForDeletedCount
197193
permission: $permission
198-
scope_id: $scope_id
199194
) {
200195
count
201196
}

0 commit comments

Comments
 (0)