Skip to content

Commit abe5115

Browse files
authored
[ENG-9835] Admin contributors getting errors while reviewing draft registrations #853
- Ticket: https://openscience.atlassian.net/browse/ENG-9835 - Feature flag: n/a ## Purpose Users with administrative permissions on a draft registration cannot access or edit certain sections of the draft (e.g., Analyses section). Instead, they receive a “You Need Permission” error. This happens even when the user is an admin on both the project and the draft registration, and even when accessing the draft through My Registrations → Drafts, which should grant full access. This issue is affecting multiple users across multiple draft registrations, and previous patterns we thought explained the issue (e.g., drafts created before a certain date, admin mismatch between project and registration) are no longer consistent. ## Summary of Changes avoid /request-access/ page redirection on /registries/drafts/* reviewing if some APIs returns 403 (/children, /files, ...)
1 parent 49eded8 commit abe5115

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/app/core/interceptors/error.interceptor.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@ export const errorInterceptor: HttpInterceptorFn = (req, next) => {
7171
if (error.url?.includes('v2/nodes/')) {
7272
const match = error.url.match(/\/nodes\/([^/]+)/);
7373
const id = match ? match[1] : null;
74-
75-
router.navigate([`/request-access/${id}`]);
74+
const draftRegistryUrlRegex = /\/registries\/drafts\/.+/i;
75+
if (!draftRegistryUrlRegex.test(router.url)) {
76+
router.navigate([`/request-access/${id}`]);
77+
}
7678
} else {
7779
router.navigate(['/forbidden']);
7880
}

0 commit comments

Comments
 (0)