Modified auth interceptor and added a test on top - #961
Merged
tickBit merged 3 commits intoSep 5, 2026
Conversation
CapoMK25
requested review from
Iir0R,
MikhailDeriabin,
hoan301298 and
psykkis
as code owners
September 5, 2026 05:56
Codecov Report❌ Patch coverage is
... and 3 files with indirect coverage changes 🚀 New features to boost your workflow:
|
tickBit
approved these changes
Sep 5, 2026
tickBit
left a comment
Collaborator
There was a problem hiding this comment.
Looks good to me. Approved.
tickBit
deleted the
955-bug-multiple-room-updates-all-at-once-doesnt-work
branch
September 5, 2026 09:35
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.
Brief description
Issue #955
I added a test to check that the behavior doesn't repeat again on top of doing the changes to the file. The functionality in the authorization interceptor file is now split into two use cases: the single object logic that was present originally, and the array logic that's added as a new addition on top of that.
Change list
Updated
AuthorizationInterceptor(src/authorization/authorization.interceptor.ts) to detect top-level array payloads(Array.isArray(request.body))duringUPDATErequests.Refactored permission evaluation to iterate over array items individually with
plainToInstance(), ensuring CASL checks permissions against individual DTO instances rather than the outer Array container type.Applied
lodash.pick()per item in array bodies to prevent field stripping and maintain correct array structure.Preserved original single-object handling logic for standard non-array update payloads.
Added a new unit test suite (
src/__tests__/authorization/authorizationInterceptor.array.test.ts) to provide testing coverage for top-level array updates passing through the authorization interceptor.