Add permission checking to all RainMachine services#22399
Merged
balloob merged 7 commits intoApr 1, 2019
Conversation
b4ee99b to
390cac3
Compare
uchagani
reviewed
Mar 27, 2019
balloob
reviewed
Mar 27, 2019
balloob
reviewed
Mar 28, 2019
balloob
reviewed
Mar 28, 2019
Contributor
Author
b97c594 to
e8c0fe2
Compare
houndci-bot
reviewed
Mar 31, 2019
balloob
approved these changes
Apr 1, 2019
| }, extra=vol.ALLOW_EXTRA) | ||
|
|
||
|
|
||
| def _check_valid_user(hass): |
Member
There was a problem hiding this comment.
Shouldn't we make this a helper decorator? There's nothing here that is specific to rainmachine. It could be used on any domain that has entity registry support that needs to do the same check, if we pass in domain.
Contributor
Author
There was a problem hiding this comment.
Yes, love that idea. I'll submit a PR.
Member
There was a problem hiding this comment.
@bachya and then maybe also update your implementation here so that you do something like this:
check_valid_user = GEN_FUNC(hass, DOMAIN)
@check_valid_user
async def handle_bla(call):That way the decorator is re-used instead of re-generated each time.
3 tasks
jonbeckman
pushed a commit
to jonbeckman/home-assistant
that referenced
this pull request
Apr 7, 2019
…2399) * Add permission checking to all RainMachine services * Linting * Some initial work * Owner comments * Test in place (I think) * Linting * Update conftest.py
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:
This PR implements user permission checking on all RainMachine services (per the "Can I Have User Permissions?" blog post).
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):Checklist:
tox. Your PR cannot be merged unless tests pass