Отдавать в /api/request-type-access список SharePoint-списков типа
Доступ здесь настраивает только видимость в UI approval-route — права SharePoint остаются ручным шагом, и раньше администратору приходилось отдельно смотреть, в какие списки данных (архив + текущая партиция) заводить чтение для email. Теперь RequestTypeAccessDto несёт готовую серию (переиспользует ListPartitionService), и админка показывает её колонкой в таблице. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -45,6 +45,14 @@ export const RequestTypeAccessScreen: React.FC<IRequestTypeAccessScreenProps> =
|
||||
|
||||
const requestTypeName = (id: number): string => requestTypes.items.find(rt => rt.id === id)?.name ?? `#${id}`;
|
||||
|
||||
// Список SharePoint нужно вручную открыть на чтение этому email — иначе доступ
|
||||
// здесь настраивает только видимость в UI approval-route, но не в самом
|
||||
// SharePoint (поиск по порталу отфильтрует чужие заявки правами списка).
|
||||
const formatSharePointLists = (item: RequestTypeAccess): string =>
|
||||
item.sharePointLists.length === 0
|
||||
? texts.common.empty
|
||||
: item.sharePointLists.map(l => l.title ?? l.listId).join(', ');
|
||||
|
||||
const openCreate = (): void => {
|
||||
setRequestTypeId('');
|
||||
setEmail('');
|
||||
@@ -86,6 +94,7 @@ export const RequestTypeAccessScreen: React.FC<IRequestTypeAccessScreenProps> =
|
||||
columns={[
|
||||
{ key: 'requestType', header: texts.requestTypeAccess.columnRequestType, render: r => <PrimaryCell>{requestTypeName(r.requestTypeId)}</PrimaryCell> },
|
||||
{ key: 'email', header: texts.requestTypeAccess.columnEmail, render: r => r.email },
|
||||
{ key: 'sharePointLists', header: texts.requestTypeAccess.columnSharePointLists, render: formatSharePointLists },
|
||||
{
|
||||
key: 'actions',
|
||||
header: '',
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
// DTO эндпоинта api/request-type-access (Application/RequestTypeAccesses/*.cs).
|
||||
import { RequestListPartition } from './requestTypeLists';
|
||||
|
||||
export interface RequestTypeAccess {
|
||||
id: number;
|
||||
requestTypeId: number;
|
||||
email: string;
|
||||
/**
|
||||
* Вся серия SharePoint-списков данных типа заявки (архив + текущая партиция) —
|
||||
* именно на них нужно вручную выдать email'у право чтения, иначе поиск по
|
||||
* порталу продолжит отдавать только его собственные заявки: этот реестр
|
||||
* настраивает видимость в UI approval-route, а не права SharePoint.
|
||||
*/
|
||||
sharePointLists: RequestListPartition[];
|
||||
}
|
||||
|
||||
export interface CreateRequestTypeAccessInput {
|
||||
|
||||
@@ -187,6 +187,7 @@ export const texts = {
|
||||
emptyList: 'Пока никому не выдан доступ ни к одному типу заявок.',
|
||||
columnRequestType: 'Тип заявки',
|
||||
columnEmail: 'Сотрудник',
|
||||
columnSharePointLists: 'Списки SharePoint (выдать доступ вручную)',
|
||||
createTitle: 'Выдать доступ',
|
||||
requestTypeLabel: 'Тип заявки',
|
||||
requestTypePlaceholder: 'Выберите тип заявки',
|
||||
|
||||
Reference in New Issue
Block a user