Closed tolgaOzen closed 1 month ago
The changes introduce a conditional check in the SubjectPermission
method of the SubjectPermissionEngine
struct to handle cases where the refs
slice is empty. When empty, the method returns an emptyResp
response and a nil
error, optimizing the execution path by preventing unnecessary processing. Additionally, a new test case is added to the test suite for the permission engine to validate its behavior when there are no relationships defined, enhancing test coverage for scenarios involving empty references.
File | Change Summary |
---|---|
internal/engines/subjectPermission.go | Added a conditional check in SubjectPermission method to return emptyResp if refs is empty. |
internal/engines/subjectPermission_test.go | Introduced a new test case for handling empty references in the subject permission engine. |
In the garden of code, where permissions play,
A check was added to brighten the day.
When refs are empty, a swift response flies,
No need for the goroutine, just clear, open skies.
With tests to ensure all is well in the land,
The engine now dances, perfectly planned! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
Bug Fixes