This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23033 - Requesting PermissionDeniedError to be added
Summary: Requesting PermissionDeniedError to be added
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: WebIDL (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Cameron McCormack
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 23035
  Show dependency treegraph
 
Reported: 2013-08-21 12:02 UTC by Harald Alvestrand
Modified: 2016-05-11 16:27 UTC (History)
12 users (show)

See Also:
philipj: needinfo? (cam)


Attachments

Description Harald Alvestrand 2013-08-21 12:02:50 UTC
In the DOMError error code list, the WebRTC working group would like to have added.

Name: PermissionDeniedError
Description: User or security policy denied the request

The main use case is to return this error when an user does not grant permission to access his camera.

No error code is needed.

Specification link: http://dev.w3.org/2011/webrtc/editor/getusermedia.html#attributes-4
Comment 1 Anne 2013-10-29 11:39:19 UTC
IDL needs to take care of the exception story for the web. Reassigning relevant bugs.
Comment 2 Nikhil 2014-04-24 10:53:10 UTC
Bumping this since this issue was raised in the context of the Push API.

When a user explicitly denies push permission when an application calls register(), we'd like to reject with PermissionDeniedError.
Comment 3 Anne 2014-04-24 13:13:43 UTC
Nikhil, just go for it. The name for the DOMException can be added to IDL later. Make sure you indicate it's a DOMException.
Comment 4 Harald Alvestrand 2014-04-24 13:29:16 UTC
Is there a theory for when "later" is in the sentence "can be added to IDL later"?

This has been hanging around for 8 months now, and I've seen no action from the assignee on it.
Comment 5 Anne 2014-04-24 13:41:42 UTC
IDL is not a project with proper staffing.
Comment 6 Marcos Caceres 2014-04-24 15:00:26 UTC
(In reply to Harald Alvestrand from comment #0)
> In the DOMError error code list, the WebRTC working group would like to have
> added.

You should not use DOMError for anything. See red note:
http://dom.spec.whatwg.org/#interface-domerror

 
> Name: PermissionDeniedError
> Description: User or security policy denied the request
> 
> The main use case is to return this error when an user does not grant
> permission to access his camera.
> 
> No error code is needed.
> 
> Specification link:
> http://dev.w3.org/2011/webrtc/editor/getusermedia.html#attributes-4

This is bug for the DOM spec, no? Not part of WebIDL?
Comment 7 Anne 2014-04-24 15:19:11 UTC
No it is for IDL, see red note: http://dom.spec.whatwg.org/#errors ^_^
Comment 8 Marcos Caceres 2014-04-24 15:25:04 UTC
(In reply to Anne from comment #7)
> No it is for IDL, see red note: http://dom.spec.whatwg.org/#errors ^_^

heh, red note hot potato :)
Comment 9 Michael van Ouwerkerk 2014-10-09 15:09:18 UTC
I'd like to get this specced somwhere. I'm not in favor of monkey patching this in the Push API. If IDL is not staffed, it seems better to add it to DOM than to define it in Push.
Comment 10 Anne 2014-10-09 15:15:40 UTC
Michael, it's not entirely clear to me the user refusing permission is an error (see recent discussion on WHATWG list), but ignoring that the best way forward is to simply use DOMException and mint a new name if the names from http://heycam.github.io/webidl/#idl-DOMException-error-names are not satisfactory. I'm sure it will be added at some point.

It will no longer be added to DOM, as IDL recently took over the definition of DOMException. Too low-level for DOM now to touch.
Comment 11 Michael van Ouwerkerk 2014-10-09 15:36:02 UTC
Hi Anne, I did see the whatwg discussion on permission requests and promises. The Push API does not have a method for explicitly requesting permissions. Check the spec for details, I think promise rejection when permission is denied is appropriate for the current API design. Fulfilling the promise for the register method successfully requires a PushRegistration which would not exist if permission was rejected.

How can we proceed on getting PermissionDeniedError in WebIDL then? Should I ping Cameron or are there other editors for WebIDL that can do this?
Comment 12 Anne 2014-10-09 15:40:33 UTC
Just leave this bug open and start using the new name. It's just a registry after all.
Comment 13 Philip Jägenstedt 2016-02-22 08:40:56 UTC
Ping!

It looks to me like PermissionDeniedError is the union of SecurityError and NotAllowedError [1] so how should spec editors pick going forward?

[1] https://github.com/heycam/webidl/pull/85
Comment 14 Jeffrey Yasskin 2016-05-11 16:27:48 UTC
Closing this to match https://github.com/heycam/webidl/issues/95.