fix: Access Control Modal user picker uses /user-directory
The form populated its candidate list via the admin-only `GET /v2/users`, so opening Route Access Settings as a non-admin caller (e.g. an org owner managing their own route in the enterprise plugin) returned 403. Add a `queryUserDirectory` client wrapper around the slim `/v2/user-directory` endpoint (gated to platform admin OR org owner) and switch `getUserList` over. Response shape is the same so the rest of the form is unchanged.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { PageAction } from '@/config';
|
||||
import { PageActionType } from '@/config/types';
|
||||
import { RouteItem } from '@/pages/model-routes/config/types';
|
||||
import { queryUsersList } from '@/pages/users/apis';
|
||||
import { queryUserDirectory } from '@/pages/users/apis';
|
||||
import { DownOutlined, QuestionCircleOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
AlertBlockInfo,
|
||||
@@ -112,7 +112,7 @@ const AccessControlForm = forwardRef((props: AccessControlFormProps, ref) => {
|
||||
|
||||
const getUserList = async (query: Global.SearchParams) => {
|
||||
try {
|
||||
const res = await queryUsersList(query);
|
||||
const res = await queryUserDirectory(query);
|
||||
const options = res.items.map((item) => ({
|
||||
title: item.username,
|
||||
key: item.id,
|
||||
|
||||
Reference in New Issue
Block a user