Skip to content

Commit 75af6d6

Browse files
authored
Merge pull request #790 from IABTechLab/sas-UID2-3641-better-messaging
Sas UI d2 3641 better messaging
2 parents 9237283 + d44ecd3 commit 75af6d6

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/api/middleware/userRoleMiddleware.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ export const isSuperUserCheck: Handler = async (req: ParticipantRequest, res, ne
2828
// assign uid2 support if user has prod-uid2.0-support in Microsoft Entra ID
2929
export const isUid2Support = async (req: Request) => {
3030
const authGroups = (req.auth?.payload?.groups as string[] | undefined) ?? [];
31-
if (isSuperUser(req) || authGroups.includes(developerRole) || authGroups.includes(uid2SupportRole)) {
31+
if (
32+
isSuperUser(req) ||
33+
authGroups.includes(developerRole) ||
34+
authGroups.includes(uid2SupportRole)
35+
) {
3236
return true;
3337
}
3438

@@ -55,8 +59,7 @@ export const isAdminOrUid2SupportCheck: Handler = async (req: ParticipantRequest
5559
const user = await findUserByEmail(userEmail);
5660
const userParticipant = user?.participants?.find((item) => item.id === participant?.id);
5761
const userIsAdminOrUid2Support =
58-
userParticipant?.currentUserRoleIds?.includes(UserRoleId.Admin) ||
59-
(await isUid2Support(req));
62+
userParticipant?.currentUserRoleIds?.includes(UserRoleId.Admin) || (await isUid2Support(req));
6063
if (!userIsAdminOrUid2Support) {
6164
return res.status(403).json({
6265
message: 'Unauthorized. You do not have the necessary permissions.',

src/web/components/Home/SharingPermissionCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function SharingPermissionCard({
4242
) : (
4343
<div className='no-sharing-permissions-banner'>
4444
<Banner
45-
message='You do not have access to this feature. To get access, please contact Support.'
45+
message='Use of sharing requires an API key or client-side key pair. Please reach out to our support team for assistance.'
4646
type='Info'
4747
fitContent
4848
/>

src/web/utils/urlHelpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ export const extractLocationFromPath = (path: string) => {
2626
};
2727

2828
export function getPathWithParticipant(path: string, participantId: string | number | undefined) {
29-
const location = extractLocationFromPath(path);
29+
const location = extractLocationFromPath(path).replace(/^\//, '');
3030
return `/participant/${participantId}/${location}`;
3131
}

0 commit comments

Comments
 (0)