[Feature Permissions] RE: ACTION-436: Provide an example for Permissions

  if (response == 2) {  // should use USER_ALLOWED constant

Also, in the spec http://dev.w3.org/2009/dap/perms/FeaturePermissions.html


The description for "feature" in section 3.2 Methods seems to be incorrect. It said "Returns one of the permission values USER_ALLOWED, DEFAULT_ALLOWED, DEFAULT_DENIED, USER_DENIED." Instead of "Describes the feature that is been requested for permission to access"


Thanks
Dzung Tran


-----Original Message-----
From: public-device-apis-request@w3.org [mailto:public-device-apis-request@w3.org] On Behalf Of Josh Soref
Sent: Wednesday, August 31, 2011 8:05 AM
To: Wonsuk Lee; public-device-apis@w3.org
Subject: RE: ACTION-436: Provide an example for Permissions

Wongsuk wrote:
> var featureID = "contacts";
> function doSomeThing() {
>  // Getting the permission level of a feature
>  var response = navigator.permissionLevel(featureID);
>
>  if (response === 2) {   //  USER_ALLOWED = 2
>    // Do something with USER_ALLOWED permission
>     getContacts(); // Perform an contacts search

This should be either `a contact` or `a contacts` (certainly not `an`)

>                     ...
>  }

Please note that you should have braces for the else block:
>  else
>    // Do something with USER_DENIED permission

>    alert("This web app will be working except your "+featureID+" information");

s/your/there will be no integration to retrieve/

> }
> navigator.requestPermission(featureID, doSomeThing);

Note that this message is not an endorsement of the feature...

---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

Received on Wednesday, 31 August 2011 16:49:11 UTC