Skip to content

Fix canAccess is called even when disableAuthentication is true#10691

Merged
djhi merged 7 commits intomasterfrom
fix-disableAuthentication-canAccess
Apr 23, 2025
Merged

Fix canAccess is called even when disableAuthentication is true#10691
djhi merged 7 commits intomasterfrom
fix-disableAuthentication-canAccess

Conversation

@slax57
Copy link
Contributor

@slax57 slax57 commented Apr 23, 2025

Problem

Setting disableAuthentication to true should prevent all calls to the authProvider, i.e. calls to checkAuth but also canAccess.
However in some cases, if checkAuth was already called earlier and the result is already in the react-query cache, a call to canAccess might still be fired.

Solution

Fix the condition under which canAccess is called from the controllers.

How To Test

Unit tests and stories were added in this PR.

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature
  • The PR includes unit tests (if not possible, describe why)
  • The PR includes one or several stories (if not possible, describe why)
  • The documentation is up to date

Also, please make sure to read the contributing guidelines.

@slax57 slax57 added the RFR Ready For Review label Apr 23, 2025
@djhi djhi added this to the 5.7.4 milestone Apr 23, 2025
@djhi djhi merged commit 9a46596 into master Apr 23, 2025
16 checks passed
@djhi djhi deleted the fix-disableAuthentication-canAccess branch April 23, 2025 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RFR Ready For Review

Development

Successfully merging this pull request may close these issues.

2 participants