W3C home > Mailing lists > Public > public-device-apis-log@w3.org > November 2016

Re: [sensors] granularity of Permission name for concrete/ fusion sensors

From: Tobie Langel via GitHub <sysbot+gh@w3.org>
Date: Mon, 14 Nov 2016 16:01:36 +0000
To: public-device-apis-log@w3.org
Message-ID: <issue_comment.created-260376376-1479139292-sysbot+gh@w3.org>
> let s = new HeadTrackerSensor();
> permissions.query(s).then(/.../);

Yes, this could be thought of as something like:

```js
HeadTrackerSensor.prototype.getPermission = function() {
    return ["gyroscope", "magnetometer"];
};

Permissions.prototype.query = function(...args) {
    args.map(function(arg) {
        if (typeof arg.getPermission === "function") {
            return arg.getPermission();
        } else {
            return arg;
        } 
    });
    // do stuff
};
```

-- 
GitHub Notification of comment by tobie
Please view or discuss this issue at 
https://github.com/w3c/sensors/issues/132#issuecomment-260376376 using
 your GitHub account
Received on Monday, 14 November 2016 16:01:42 UTC

This archive was generated by hypermail 2.4.0 : Monday, 4 July 2022 12:47:53 UTC