имперсонейшн
This commit is contained in:
@@ -7,6 +7,7 @@ import '@pnp/sp/site-users/web';
|
||||
import '@pnp/sp/search';
|
||||
import { WebPartContext } from '@microsoft/sp-webpart-base';
|
||||
import { getRequestTypes, IRequestType, REQUEST_STATUS } from '../../shared/approval';
|
||||
import { effectiveUserEmail } from '../../shared/impersonation';
|
||||
import { IMyRequest } from './models/IMyRequest';
|
||||
import { IMyRequestsTypeDebug } from './models/IMyRequestsDebug';
|
||||
|
||||
@@ -53,8 +54,12 @@ const MP_APPROVER = 'TansuSiteApproverOWSUSER';
|
||||
// AuthorOWSUSER, статус ни при чём.
|
||||
const MP_STATUS = 'ApprovalStatusOWSCHCS';
|
||||
|
||||
// effectiveUserEmail, а не pageContext напрямую: при отладочной подмене личности
|
||||
// (см. shared/impersonation.ts) «мои заявки» и очереди согласования должны
|
||||
// отбираться по подменённому сотруднику — иначе подмена показывала бы чужой
|
||||
// маршрут в форме, но собственные списки заявок.
|
||||
export function currentUserEmail(context: WebPartContext): string {
|
||||
return (context.pageContext.user.email || '').toLowerCase();
|
||||
return effectiveUserEmail(context).toLowerCase();
|
||||
}
|
||||
|
||||
// Типы заявок, у которых approval-route API уже отдал listId/siteUrl (готовы к чтению).
|
||||
|
||||
Reference in New Issue
Block a user