airpingu / data-store-api

W3C working draft for Data Store API
http://airpingu.github.io/data-store-api/index.html
4 stars 2 forks source link

Elaborate more about the manifest settings for "datastores-access" #5

Closed airpingu closed 10 years ago

airpingu commented 10 years ago

For example, the data store won't be read-only to the Messaging App which can claim the following entry in its manifest:

{
  datastores-access: {
    "messaging": {
      "access": "readwrite",
      "description": "access the messaging stores"
    }
  }
}

For other apps that just want to read the data store, it can simply claim:

{
  datastores-access: {
    "messaging": {
      "access": "readonly",
      "description": "access the messaging stores"
    }
  }
}

If the app doesn't claim the datastores-access entry in its manifest, the getDataStores("messaging") will return nothing to it, which means it can neither read or write the data stores.

zolkis commented 10 years ago

More exactly, the Promise resolves to an error.

airpingu commented 10 years ago

Solved this at https://github.com/airpingu/data-store-api/commit/1d61dce41152404ae327013ec7d3cbf88190b3ff.