Create decorator to check service permissions#22667
Merged
bachya merged 17 commits intohome-assistant:devfrom Apr 13, 2019
Merged
Create decorator to check service permissions#22667bachya merged 17 commits intohome-assistant:devfrom
bachya merged 17 commits intohome-assistant:devfrom
Conversation
houndci-bot
reviewed
Apr 2, 2019
houndci-bot
reviewed
Apr 2, 2019
3 tasks
Member
MartinHjelmare
left a comment
There was a problem hiding this comment.
Looks good! I think we need a test. But let's hear what core thinks first.
Contributor
|
Haven't looked at too details, several thought:
|
Contributor
Author
balloob
reviewed
Apr 3, 2019
balloob
reviewed
Apr 3, 2019
balloob
approved these changes
Apr 3, 2019
b2e35e0 to
a1acda5
Compare
Codecov Report
@@ Coverage Diff @@
## dev #22667 +/- ##
==========================================
+ Coverage 94.13% 94.14% +<.01%
==========================================
Files 448 448
Lines 36720 36741 +21
==========================================
+ Hits 34567 34589 +22
+ Misses 2153 2152 -1
Continue to review full report at Codecov.
|
awarecan
reviewed
Apr 3, 2019
1905b05 to
0de9785
Compare
balloob
reviewed
Apr 11, 2019
balloob
reviewed
Apr 11, 2019
balloob
reviewed
Apr 11, 2019
balloob
reviewed
Apr 11, 2019
balloob
reviewed
Apr 11, 2019
balloob
reviewed
Apr 11, 2019
balloob
reviewed
Apr 13, 2019
balloob
approved these changes
Apr 13, 2019
Member
balloob
left a comment
There was a problem hiding this comment.
Ok to merge when final comment addressed
Co-Authored-By: bachya <bachya1208@gmail.com>
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.
Description:
Following up on @MartinHjelmare's and @balloob's suggestion, this PR creates a generic decorator to check user permissions on a service call belonging to a specific domain. The decorator checks the user's permissions against all entities owned by the passed-in domain.
Since this logic originally existed in the RainMachine component, this PR also replaces that logic with this decorator.
Related issue (if applicable): N/A
Pull request in home-assistant.io with documentation (if applicable): N/A
Example entry for
configuration.yaml(if applicable):N/A
Checklist:
tox. Your PR cannot be merged unless tests pass