w3c / miniapp

MiniApps Standardization
Other
370 stars 48 forks source link

Define a permission model? #117

Open xfq opened 4 years ago

xfq commented 4 years ago

Should we define a permission model for MiniApps and corresponding APIs?

Related docs:

MiniApp Manifest

Spec: https://w3c.github.io/miniapp-manifest/#req_permissions-member

W3C

Web pages/applications

Specs:

Query a permission using the navigator.permissions.query() method to return a promise that resolves with the status for a specific API.

Extensions

Docs: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/permissions

permissions.request() asks for a set of permissions.

WeChat Mini Programs

Docs: https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html

Use wx.getSetting to get the user's current permission settings (only for the permissions the Mini Program has requested before).

Use wx.authorize to ask for a set of permissions.

ByteDance Mini Programs

Docs: https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/api/other/user-authorization/

Use tt.getSetting to get the user's current permission settings (only for the permissions the Mini Program has requested before).

Use tt.authorize to ask for a set of permissions.

zhangyongjing commented 4 years ago

I think it's needed.

xfq commented 3 years ago

Yeah, we could work on a new document to define common infrastructure that other specifications can use to interact with MiniApp permissions.