You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Changes related to agent creation with no access group read perms:
agent-role.service.ts: Same change done in hashlist-role.services.ts
new-agent.component.ts: Injects PermissionService to check agent binary read perm at init time. This is a necessary companion to the role fix: once users without agent binary read perm access the page, step 1 would trigger a 403 API call crashing the component. The permission check allows the page to render gracefully without that call. This is an additional fix to the issue, not the main one. The main one (user with no access group read perm can create an agent) would be fixed only with the changes in agent-role.service.ts.
new-agent.component.html: rendering options depending on the user having binary read permissions or not.
new-agent.component.spec.ts has 3 new tests about lack of accessgroup.read permission and agentbinary.read.permission (voucher creation, no API call during agent creation and bainary table not rendered).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.