WebThingsIO / gateway

WebThings Gateway
http://webthings.io/gateway
Mozilla Public License 2.0
2.61k stars 333 forks source link

User Permissions #787

Open kgiori opened 6 years ago

kgiori commented 6 years ago

I want to add users who can access my system with "guest" privileges. They should be able to:

hobinjk commented 6 years ago

This would be great to have! #338 should form a pretty good basis for this as long as the permission denied errors are exposed to the user (which they aren't right now).

speccy88 commented 6 years ago

I would like to add that it would be useful to be able to let some users see only a limited set of devices.

benfrancis commented 5 years ago

I think this can be generalised to a permissions system for users. Currently all users have full access. Guest Users is one use case of that.

benfrancis commented 5 years ago

@draggett suggested that this could go down to the level of different permissions for different properties, actions and events.

draggett commented 5 years ago

@kgiori's idea of different permissions for guest users makes sense. Another use case is parental control of TV's where the children have restrictions in what they can view and when (e.g. no watching TV in their bedrooms after 9am). One solution is to annotate properties and actions, and then to have separate rules that parents can enable in terms of these annotations.

coreyo commented 5 years ago

We need the ability to create arbitrary security groups, the ability to assign arbitrary devices to each group, and the ability to allow actions to arbitrary users for each security group. The idea is as follows:

Suppose that I run an AirBnb. I rent out my basement which has any number of smart devices such as lights, fan, thermostat, etc. I want my guests to be able to control all devices in the basement, but none of the devices in the rest of my house. I could create a guest account with permissions to only those devices and change the password with each guest (or make it local-network-login only)

flatsiedatsie commented 4 years ago

Perhaps related a bit: it would be nice to be able to have a way to show some things without needing to log in. For example, if the WebThings Gateway is given the same physical form as something like Google Home Hub.

hub-experiment

flatsiedatsie commented 4 years ago

While developing the Candle smart home we realized that current generation smart home software often uses/assumes hierarchical user management and permission systems, but that this design might not be optimal for real-world family scenarios. In fact, increasingly we hear stories of smart home systems that are seduce its users to spy on each other, creating tensions. Especially children are having a hard time growing up in homes where their activities are surveiled, and past behaviour can be recalled in detail.

A proposal for a 'next generation' system can be found here: https://www.candlesmarthome.com/healthy-social-dynamics

If the Mozilla Gateway acknowledges these issues and designs a different system, it could gain a unique selling point and show a different way forward to the industry.

Specifically:

Underlying all this is the understanding that people constantly tell little white lies. As social animals we constantly manage our perception by others (even though we pretend we don't). Smart homes should, in my opinion, support this very human behaviour. In fact, I don't think they'll ever become very popular until they become sensitive to these issues.

benfrancis commented 4 years ago

This topic has come up before (including the issue you posted last year), and I think it's a really interesting potential differentiator.

I think this requires some further user research and UX design to come up with a system which can accommodate non-hierarchical permissions, without being too prescriptive. And without adding too much complexity. For example, I don't think we should enforce any particular decision making process on a family, but we could give them the tools and agency they need to make those decisions themselves.

Issues like giving children rights which parents can't revoke and allowing users to create fake data are tricky social issues which may not have an easy answer. But we could start with some simple mechanisms like allowing different users to own different devices, rather than having a single admin user who can access all devices (or give all users access to everything as we currently do). It could be that when a device is added it has an owner assigned who can then share ownership or grant permissions to other users.

flatsiedatsie commented 4 years ago

I think it's a really interesting potential differentiator.

That's exactly what I feel too.

I presented the concept at ThingsCon last friday, and people really got it. Especially students understood the issue. As more news about broken relationships and the impact on children surfaces, I think this will become a broader societal question in the coming years. A smart home should have the built in ability to not measure all the time, lest it becomes restrictive. A smart home shouldn't be a surveillance home.

we could start with some simple mechanisms

Sounds great! I was wondering if it would be an idea to break this down into a few concrete issues. Perhaps the simplest solution would be if the gateway has some kind of lightweight interface/AP/scaffoldingI that allows add-ons (and built-in features) to work with. That way implementation could be something that is done and explored by the community.

It could be that when a device is added it has an owner assigned who can then share ownership or grant permissions to other users.

Ownership sounds like a good place to start. Another interesting light-weight starting point could be a rights system that covers devices as well as add-ons. Then it would be possible to create experiments such as:

In the long run things could get to a point that a rights system might not be able to cover. For example, a smart lock might have a stealth lock ("pretend to be unlocked but is actually locked") state, which could be added to the WebThings schema. Similarly, being able to easily disable data logging for certain devices for a while could be a general feature of the Gateway ("don't record data from devices in the study room while grandma is staying over, because she will use it as her bedroom").

We could discuss getting development for this experiment funded through the EU or other cultural/innovation funds. There are also academics exploring these issues.

flatsiedatsie commented 4 years ago

Just a small thought experiment, thinking out loud. Here's a popup that appears if a user installs a new add-on.

gateway_rights_experiment4

As I once mused about the rules interface, it might be interesting to create an interface that puts the emphasis on manipulating sentences. The advantage would be that rules and permissions could be manipulated through speech input. The more I think about it though, having any level of security when using voice as input is really hard - the system would have to learn to recognise users by their voice. This would always be easy to hack/fake (although voice input through the browser would be easier to secure, as in that case you know which user is logged in).