Remove unused resource parameter from getPermissionsFor - #1870
Open
NaderMohamed325 wants to merge 2 commits into
Open
Remove unused resource parameter from getPermissionsFor#1870NaderMohamed325 wants to merge 2 commits into
NaderMohamed325 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Removes an unused parameter from the internal getPermissionsFor helper used to populate the WAC-Allow response header, relying on the acl instance to already be scoped to the requested resource.
Changes:
- Removed the unused
req/resource-related parameter fromgetPermissionsFor. - Updated
addPermissionsto callgetPermissionsForwith the simplified signature.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Author
|
Hi @bourgeoa / @kjetilk / @RubenVerborgh — this addresses #973 that one of you |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Removes the unused
resourceparameter fromgetPermissionsForinlib/header.js.Why
resourceis passed intogetPermissionsForbut never used inside the function body —acl.can(user, mode)doesn't take a resource argument. As confirmed in #973, theresource is already implicit in the
aclobject itself (scoped viaACLChecker.createFromLDPAndRequest, seelib/acl-checker.js), so passingresourceagain here is dead code.
Closes #973
Testing
Ran the full test suite locally on Windows. 4 pre-existing failures unrelated to this
change (CRLF/LF line-ending mismatches in OIDC integration tests, and a signup page
timeout) — confirmed these fail identically with this change stashed out.