-
Notifications
You must be signed in to change notification settings - Fork 816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[backend] fix user capabilities check for notification (#7109) #7130
Conversation
ec091ea
to
b10b94c
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7130 +/- ##
=======================================
Coverage 67.59% 67.60%
=======================================
Files 561 561
Lines 68760 68761 +1
Branches 5840 5841 +1
=======================================
+ Hits 46477 46483 +6
+ Misses 22283 22278 -5 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not understand the explanation of the issue. Even with the array [SETTINGS, SETACCESSES] it should work as SETACCESSES is a child of SETTINGS so if you have it you also have the parent?
as userCapabilities is an array of capabilities split on the "_" (line 37), the condition |
Ah, yes ok. Still feels strange we need to add a new constant to resolve the issue. Do we not have a function somewhere that already checks capabilities instead of calling directly |
b10b94c
to
73425ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use isUserHasCapability instead?
73425ad
to
a3ce2a8
Compare
the use of |
Even if we are not taking care of the global rework in this PR we can still at least use the function correctly for the 2 lines triggering the bug instead of adding hard coded strings no? |
Proposed changes
userCapabilities
, which is an array of split capabilities (=>[ 'SETTINGS, 'SETACCESSES]Related issues
Checklist
Further comments