user with no accessGroup read perms can create hashlist#613
user with no accessGroup read perms can create hashlist#613LuffyNoNika wants to merge 4 commits intomasterfrom
Conversation
|
Changes related to agent creation with no access group read perms:
|
…en-no-accesgroup-read-permission
|
Last commit 95af08c adapts new-hashlist.component.spec to the deserialization to Zod schema and includes jsonapi field required by Zod validation |
Changed files:
hashlist-role.service.ts: Removed Perm.GroupAccess.READ from the "create" role so users without that permission can still create hashlists.
new-hashlist.component.ts: Fetches access grups via getRelationships (user-scoped) with X-Skip-Error-Dialog: true to suppress the 403 toast. Falls back to a disabled "Default" access group (ID 1) on error or empty response.
main.service.ts: Added optional "options" parameter to getRelationships to support passing custom HTTP headers (needed for the 403 suppression above).
specs verify that getRelationships is called with tthe error-dialog: true header + some additional regression tests.
Note: new-files.component.ts suffers from the same bug. It fetched access groups via getAll(SERV.ACCESS_GROUPS), which also fails with 403 for users without permAccessGroupRead. The same fallback pattern was applied for consistency, along with a minor fix found during testing: successful imports from the server import directory didn't redirect back to the file list. Since creating a hashlist requires uploading a hash source (file), it makes sense to me to apply the same fix here.