Skip to content

Prevent unnecessary permission API request#24178

Merged
rijkvanzanten merged 2 commits intomainfrom
prevent-unnecessary-perm-api-req
Dec 9, 2024
Merged

Prevent unnecessary permission API request#24178
rijkvanzanten merged 2 commits intomainfrom
prevent-unnecessary-perm-api-req

Conversation

@paescuj
Copy link
Contributor

@paescuj paescuj commented Dec 9, 2024

Scope

The isActionAllowed function was designed in a way to prevent unnecessary API requests. That is, if the permissions for a collection are either "none" or "full", there's no need to check the permissions for individual items (/permissions/me/<collection>/<item> endpoint).
With the introduction of the policy system, this no longer worked as intended for the "none" permissions case.
Therefore, the function and associated tests have now been adjusted accordingly.

@paescuj paescuj requested a review from a team December 9, 2024 15:10
@changeset-bot
Copy link

changeset-bot bot commented Dec 9, 2024

🦋 Changeset detected

Latest commit: db7a662

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@directus/app Patch
@directus/api Patch
directus Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@rijkvanzanten rijkvanzanten merged commit 1efcb68 into main Dec 9, 2024
@rijkvanzanten rijkvanzanten deleted the prevent-unnecessary-perm-api-req branch December 9, 2024 15:35
@github-actions github-actions bot added this to the Next Release milestone Dec 9, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants