Fix ui.isAccessAllowed
when undefined
to prevent access
#8771
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.
Please see the security vulnerability report for an up-to-date description and work-around if you can't update.
What happened
The default AdminUI middleware prevents access to the AdminUI if
session
strategy configuration has been defined, andcontext.session
isundefined
or falseyThis is not what happens for the
adminMeta
GraphQL query, which falls back on public access whenisAccessAllowed
is undefined.The GraphQL and AdminUI middleware behaviour should be the same.
We haven't committed or documented what the behaviour should be, so what we fall back on is open ended.
In this pull request, I have opted to fall back to the same behaviour as the default Admin UI middleware, as the behaviour that users would have observed and probably expect.