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

Move permissions out to each spec #263

Closed
18 tasks done
marcoscaceres opened this issue Aug 2, 2021 · 6 comments · Fixed by #353
Closed
18 tasks done

Move permissions out to each spec #263

marcoscaceres opened this issue Aug 2, 2021 · 6 comments · Fixed by #353

Comments

@marcoscaceres
Copy link
Member

marcoscaceres commented Aug 2, 2021

The Permissions registry seems a roundabout way to maintain things.... I think we definitely keep the various parts other specs need to define (plus an example of what other specs need to do), keep the enum, but then move all permission descriptions to their respective specs.

That allows this spec to "gate-keep" the main enum for the API, but allows other specs to define their own permissions.

TODO:

@jyasskin
Copy link
Member

jyasskin commented Aug 2, 2021

I tried to do this at some point by having each spec <dfn> its PermissionName enum value, but IIRC Bikeshed didn't autolink from https://w3c.github.io/permissions/#enumdef-permissionname to definitions outside the current spec, and writing that enum manually broke reffy's IDL parser. https://w3c.github.io/permissions/#bluetooth is the maximum amount of "define everything in the feature's spec" that seemed possible, but going that far seems like a good idea.

@marcoscaceres
Copy link
Member Author

My plan is to separate the concept of a "permission" (a new definition type), and those independent of the enum values. Specs now routinely define an "Integration with Permissions Policy" section where they identify the permission string they are using. Our spec will just define the enum and values, but not claim to be the permission itself.

That way, we can avoid the auto-linking issues (🤞) and everyone can own their own stuff.

@hamishwillee
Copy link

@marcoscaceres Somewhat related to this, should web-share be listed as a permission in the spec? I ask because there appears to be a 1:1 mapping to the Permission Policy definitions for most permissions and permission policy settings..

It isn't totally clear what the mapping "should" be (to me). Is the following correct?

  • permissions control what options are offered to users via the browser settings or GUI when you try to use an API.
  • permission policy determines what the server thinks you should be able to use, and generally might be what sets the permission or what makes it visible to a user.

Further, more closely related, if you move the permissions out to specs it would be really helpful to provide some information about where they are going to. Then we can update the browser compatibility info https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API#browser_compatibility with spec links.

@marcoscaceres
Copy link
Member Author

marcoscaceres commented Aug 27, 2021

@marcoscaceres Somewhat related to this, should web-share be listed as a permission in the spec? I ask because there appears to be a 1:1 mapping to the Permission Policy definitions for most permissions and permission policy settings.

No, and I totally understand that it looks like there is a 1:1 mapping. This is something I'm actually trying to fix.

This spec will only deal with APIs that prompt for UI: like Geolocation.

I added some text to try to explain the relationship between the two specs:
https://w3c.github.io/permissions/#relationship-to-permissions-policy

For the case of "web-share", there is no permission prompt UI in any browser - hence, it's not part of this spec.

It isn't totally clear what the mapping "should" be (to me). Is the following correct?

  • permissions control what options are offered to users via the browser settings or GUI when you try to use an API.

Yes, what we call "power features" in our spec. Powerful features (e.g., geolocation) need to get "permission" via some UI.

permission policy determines what the server thinks you should be able to use, and generally might be what sets the permission or what makes it visible to a user.

Correct (I wish Permissions Policy wouldn't of changed their name - it's made everything very confusing!)...

A "permissions" per the Permission Policy spec control the availability of an API in a given context, for example:

<!-- this allows geolocation -->
<iframe allow="geolocation" src="https://third-party.com"></iframe>

Further, more closely related, if you move the permissions out to specs it would be really helpful to provide some information about where they are going to. Then we can update the browser compatibility info https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API#browser_compatibility with spec links.

Sure! should I ping you directly? I can add something to our pull request template.

@hamishwillee
Copy link

  1. Excellent summary of the differences in the APIs in the spec. Wish I'd know about that 6 months ago :-). One typo "Policy governs wether a feature ..."
  2. I'll try and make sure this is untangled more on MDN too. Might take a little while.
  3. Rather than ping me, please create an issue here: https://github.com/mdn/content/issues and @hamishwillee tag me in it. That way if something happens to me someone else can pick it up.

Thanks again for your help.

@marcoscaceres
Copy link
Member Author

Where applicable, we should add a "Permission prompt" heading/section to specs and add:

  • it is a default power feature,
  • and any step/algorithms there...

anssiko added a commit to w3c/sensors that referenced this issue Nov 19, 2021
Remove references to enum PermissionName and refer to powerful
feature 'name' dfn instead.

Helps with w3c/permissions#263
anssiko added a commit to w3c/ambient-light that referenced this issue Nov 19, 2021
anssiko added a commit to w3c/accelerometer that referenced this issue Nov 19, 2021
anssiko added a commit to w3c/gyroscope that referenced this issue Nov 19, 2021
anssiko added a commit to w3c/magnetometer that referenced this issue Nov 19, 2021
miketaylr pushed a commit to miketaylr/ambient-light that referenced this issue Oct 18, 2022
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 a pull request may close this issue.

3 participants