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

Add permission for Accelerometer, Gyroscope, Magnetometer and Orientation Sensor #142

Merged
merged 1 commit into from
Apr 19, 2017

Conversation

riju
Copy link
Contributor

@riju riju commented Mar 31, 2017

Fixes #141.

@riju
Copy link
Contributor Author

riju commented Mar 31, 2017

@tobie : PTAL.

@tobie
Copy link
Member

tobie commented Mar 31, 2017

I think this needs more discussion. What's the relationship between those permissions? i.e. what happens when the orientation-sensor permission is granted and then further along the gyroscope permission is requested? Etc.

@anssiko
Copy link
Member

anssiko commented Mar 31, 2017

Currently no relationship, each one is considered separately. Based on the learnings from the recent WebVR Origin Trial, I feel we actually should ship this as an experiment in order to have definitive answer to this kind of ergonomics issues.

I leave it to the editors to decide whether to land this spec patch now and possibly adjust later, or leave this open until we have gathered such web developer feedback by shipping an experiment.

@tobie
Copy link
Member

tobie commented Mar 31, 2017

I feel we actually should ship this as an experiment in order to have definitive answer to this kind of ergonomics issues.

I doubt you'll have anything clear as an answer here unless you ship all motion sensors API together. Not to mention that some of the concerns are related to yet to be released permissions APIs.

@riju riju changed the title Add permission for Accelerometer, Gyroscope, Magnetometer Orientation Sensor Add permission for Accelerometer, Gyroscope, Magnetometer and Orientation Sensor Apr 3, 2017
@riju
Copy link
Contributor Author

riju commented Apr 3, 2017

Something concrete as proposed by the Chrome Privacy/Security team after some analysis is as follows:

AMBIENT_LIGHT_SENSOR: opt-out UI. granted by default.
MAGNETOMETER: opt-out UI. granted by default.
ORIENTATION_SENSOR: opt-out UI. granted by default.

ACCELEROMETER: auto-grant. no UI.
GYROSCOPE: auto grant. no UI.

We would go into origin trial with this model, get feedback from developers, and are open to change the policy based on feedback.

@riju
Copy link
Contributor Author

riju commented Apr 3, 2017

Regarding this PR, iirc it was agreed in TPAC that we use granular permission names.
Details : w3c/sensors#22 (comment)

So that implementation can later use whatever privacy policy them deem fit on top of this
w3c/sensors#174 (comment)

@tobie
Copy link
Member

tobie commented Apr 3, 2017

Regarding this PR, iirc it was agreed in TPAC that we use granular permission names.

Yes. That was the conclusion then. There's now evidence that this probably won't work well in practice, especially for motion sensors, will cause issues with new APIs (such as revoking permissions), and needs further research/work.

@anssiko
Copy link
Member

anssiko commented Apr 3, 2017

I doubt you'll have anything clear as an answer here unless you ship all motion sensors API together.

That's the plan for the Chrome Origin Trial.

@marcoscaceres any concerns? We'd like to land this to have it documented before we enter Origin Trial to gather web developers' feedback on the model. Follows 4f95684

@tobie
Copy link
Member

tobie commented Apr 3, 2017

I doubt you'll have anything clear as an answer here unless you ship all motion sensors API together.

That's the plan for the Chrome Origin Trial.

I meant all motion sensors not just these four.

@marcoscaceres
Copy link
Member

@anssiko, maybe we can add a note to the spec to say that these are under an origin trial - and that we are testing how the combination works together? @tobie, would that help a bit?

@anssiko
Copy link
Member

anssiko commented Apr 4, 2017

@marcoscaceres, that is indeed a very good idea.

@tobie, please propose a good wording for the note, perhaps linking to your related research and/or the issue in w3c/sensors so people know where to go to provide further feedback on the topic.

@anssiko
Copy link
Member

anssiko commented Apr 5, 2017

@riju, please add the following note below the enum PermissionName block:

Note: The enumeration values {{accelerometer}}, {{gyroscope}}, {{magnetometer}}, and
{{orientation-sensor}} are considered provisional and are subject to change based on
feedback from early implementations. See
<a href="https://github.com/w3c/sensors/issues/22">w3c/sensors#22</a> issue for
more information.

With this addition we should be good to land this PR, right @tobie and @marcoscaceres?

@tobie
Copy link
Member

tobie commented Apr 5, 2017

LGTM.

index.bs Outdated
<p>
The <dfn for="PermissionName" enum-value>"magnetometer"</dfn>
permission is the permission associated with the usage of the
[[ambient-light]] API.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be magnetometer?

index.bs Outdated
<p>
The <dfn for="PermissionName" enum-value>"orientation-sensor"</dfn>
permission is the permission associated with the usage of the
[[ambient-light]] API.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

orientation sensor?

@pozdnyakov
Copy link

@riju think it's worth dropping "orientation-sensor" from the list due to w3c/orientation-sensor#33

index.bs Outdated
<a enum-value>"clipboard"</a>,
};
</pre>
<p class="note">
The enumeration values {{accelerometer}}, {{gyroscope}}, {{magnetometer}}, and
{{orientation-sensor}} are considered provisional and are subject to change
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this still mentions orientation-sensor

Add note for the new sensor permission types.
Note that we considered using a permission type for orientation-sensor,
but finally decided against it.
Details: w3c/orientation-sensor#33
@anssiko
Copy link
Member

anssiko commented Apr 19, 2017

@marcoscaceres, thanks for your patience with this one.

We now have LGTMs from @tobie and me, and all the review comments from @raymeskhoury have been addressed. @riju squashed the multiple commits into one so you can maintain your beautiful commit history :-)

@marcoscaceres, feel free to land this so we can advance with the implementation.

@marcoscaceres marcoscaceres merged commit e9623d7 into w3c:master Apr 19, 2017
@anssiko
Copy link
Member

anssiko commented Apr 19, 2017

Thanks @marcoscaceres! We owe you a 🍻

@marcoscaceres
Copy link
Member

I'll be taking you up on that at TPAC! 💃

MXEBot pushed a commit to mirror/chromium that referenced this pull request Aug 3, 2017
This is the first part of adding permission guard for sensors based on Generic Sensor Framework.
There was consensus to add granular permissions for sensors here
w3c/sensors#22

This CL adds permission name for the different sensors in the permission module.

Spec discussion : w3c/permissions#142

BUG=606766

Review-Url: https://codereview.chromium.org/2791623004
Cr-Commit-Position: refs/heads/master@{#491303}
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

Successfully merging this pull request may close these issues.

6 participants