-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Adds count class level permission #3814
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3814 +/- ##
==========================================
+ Coverage 90.14% 90.17% +0.03%
==========================================
Files 114 114
Lines 7526 7529 +3
==========================================
+ Hits 6784 6789 +5
+ Misses 742 740 -2
Continue to review full report at Codecov.
|
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.
looks good to me. good for me to see tool. can you give me some clarity on the unit test description question i made?
spec/CloudCode.spec.js
Outdated
}); | ||
}); | ||
|
||
it('should report count if passed', (done) => { |
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.
the test description is the same as above. maybe should be 'should report find if passed', but i'm confused what you're testing and why. what does it mean "to report" in this context?
i just see that the result is zero as expected and your hook is called for both find and count.
return schema.setPermissions('Stuff', { | ||
'create': {'*': true}, | ||
'find': {'*': true}, | ||
'count': count |
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'm assuming that count = {}
is roughly equivelent to count = { '*': false }
?
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.
yeah but *: false
is not a valid CLP, {}
means lockdown, no one can execute a count
.then(schema => { | ||
var count = {}; | ||
return schema.setPermissions('Stuff', { | ||
'create': {'*': true}, |
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.
no quotes around object members
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.
That was to match the style of the rest of the file, we'll update those at a later time (i.e. test linting)
src/triggers.js
Outdated
var request = { | ||
triggerName: triggerType, | ||
query: query, | ||
master: false, | ||
count: count, |
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.
fyi, you could just have count
instead of count: count
.
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.
That was to match the style, I'll update :)
@acinader pushed some nits |
Partial resolution for #3813