Skip to content
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

Groups #87

Closed
balloob opened this issue Oct 2, 2018 · 7 comments
Closed

Groups #87

balloob opened this issue Oct 2, 2018 · 7 comments

Comments

@balloob
Copy link
Member

balloob commented Oct 2, 2018

For permissions, we need to add groups to the user system. The idea is that permission policies will be attached to groups instead of users. That way it's easy to have a group of "Visitors" or "Kids" with reduced access to rooms and devices.

I would want to keep the "is_owner" flag on the user and that only one owner can exist. For permissions, an owner is treated like a "Super Admin" and will always have access to everything, regardless of the group and it's policy the owner belongs to.

A basic implementation of groups as I just described is available here: home-assistant/core#16935 . It introduces two groups "System" and "Family". Users in the system group will be protected from changes. Examples will be Hass.io, Google Assistant etc. The Family group is the group with the normal users (name can be changed).

@awarecan
Copy link

awarecan commented Oct 3, 2018

One user can only belongs one group is not intuitive. I will suggest the underlying implement should support multiple groups per user. For the first phase, we can limit it to one in the UI.

It is complex but doable if we have user:group and group:policy both support m:n mapping, therefore we should have some sort smash process to compute the effective permissions for each user, cache and serialization as well.

@cgarwood
Copy link
Member

cgarwood commented Oct 3, 2018

Agreed, we should definitely allow users to be in multiple groups

@balloob
Copy link
Member Author

balloob commented Oct 3, 2018

Please include some use cases for multiple groups. "Not intuitive" and "definitely allow" are not enough 😉

@pvizeli
Copy link
Member

pvizeli commented Oct 3, 2018

We create a group per room, and put user in the group they need access selected room.

@helto4real
Copy link

My 2 cents
Use Case:

  • group for rooms as suggested second that
  • group for specific device types as cameras for example
  • group see history of cartain devices like trackers

@balloob
Copy link
Member Author

balloob commented Oct 3, 2018

Okay, I like Pascal's use cases.

@balloob
Copy link
Member Author

balloob commented Oct 3, 2018

Updated PR to support multiple groups

@balloob balloob closed this as completed Oct 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants