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
fix: Fallback to using list auth if details auth fails, remove double cache (#1274)
## Description
This implements a fall back to using list authorization if the details
authorization returns without access to the main resource. This might
happen if
- The XACML policy doesn't define a "read" rule
- There are no GUI/API actions in the dialog referring to XACML actions
the user is granted access to
This ensures that dialogs that is visible in the list, also can be
viewed in details view, even if the user has isn't authorized for any
actions. He/she might still have access to transmissions using
authorization attributes (depending on if the authorization attribute
refers a subresource or external resource; either having
"transmissionread" in the ServiceResource policy, or having "read" on
the external resource policy)
Also, this removes a redundant double caching of list authorization.
This was a leftover after the non-scalable PDP-based authorization.
## Related Issue(s)
- #1247
This adresses the principal problem raised in #1247, which is the
discrepancy between perceived list and details authorization. We still
need to consider if GetAltinnActions should be policy-based, as that
will allow us to implement action-property validation in Create/Update
commands. This will also let us include all authorized actions in dialog
tokens in the `a` (actions) claim, not just the actions referred to in
the dialog.
## Verification
- [x] **Your** code builds clean without any errors or warnings
- [x] Manual testing done (required)
- [ ] Relevant automated test added (if you find this hard, leave it and
we'll help out)
## Documentation
- [ ] Documentation is updated (either in `docs`-directory, Altinnpedia
or a separate linked PR in
[altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if
applicable)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Introduced a new method to check list authorization for dialogs,
enhancing user access control.
- Added additional authorization checks for dialogs, allowing users with
list access to retrieve dialogs even without main resource access.
- **Bug Fixes**
- Improved error handling and validation in dialog creation tests,
ensuring robust and localized feedback.
- **Chores**
- Updated caching strategy for search authorization results to improve
performance.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy file name to clipboardexpand all lines: tests/Digdir.Domain.Dialogporten.Application.Integration.Tests/Features/V1/ServiceOwner/Dialogs/Commands/CreateDialogTests.cs
+2-1
Original file line number
Diff line number
Diff line change
@@ -228,7 +228,8 @@ public async Task Cannot_Create_Transmission_Without_Content()
0 commit comments