Skip to content

Commit

Permalink
DocWorks for wix-dashboard - 1 change detected
Browse files Browse the repository at this point in the history
changes:
Service wix-dashboard has changed description
  • Loading branch information
adamfri committed Jun 9, 2024
1 parent 9eafc31 commit 15e9dab
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
Binary file added media/dashboard-permissions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 23 additions & 5 deletions wix-dashboard/wix-dashboard.service.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,28 @@
"```js",
"import { <function> } from 'wix-dashboard';",
"```",
"",
"## Before you begin",
"It's important to note that the Wix Dashboard API can only be used in code running on dashboard pages. The functions in this API don't work in backend code or on any other pages on your site." ],
"It's important to note that the Wix Dashboard API can only be used in code running on dashboard pages. The functions in this API don't work in backend code or on any other pages on your site.",
"",
"## Dashboard permissions",
"",
"When you call Wix APIs from your dashboard page code, you need to keep in mind which permissions are available to your code. These permissions are different for dashboard pages created in the Editor and pages created with Wix Blocks.",
"",
"### Pages created in the Editor",
"",
"Permissions for code running on dashboard pages created in the Editor are scoped to the currently logged-in user. This means that if your code makes calls to APIs that the user does not have permissions to access, those calls will fail.",
"",
"For example, your dashboard page code may make a call to the [`stores` API](https://dev.wix.com/docs/velo/api-reference/wix-stores-v2/products/introduction) to add products to the site's store. However, if the user accessing the page has a [role](https://support.wix.com/en/article/roles-permissions-overview) that doesn't allow adding products, those API calls will fail.",
"",
"",
"### Pages created with Wix Blocks",
"",
"Dashboard pages created with Wix Blocks are always part of an [app](https://dev.wix.com/docs/build-an-app/develop-your-app/frameworks/wix-blocks/getting-started-with-blocks/welcome-to-wix-blocks). The code on these pages can access APIs with the permissions of the currently logged-in user, but only if the app has also been granted those permissions.",
"",
"![Dashboard Permissions](../assets/images/dashboard-permissions.png)",
"",
"For example, if your app has permissions to add products to a store, but the current user does not, your app will not be able to use the [`stores` API](https://dev.wix.com/docs/velo/api-reference/wix-stores-v2/products/introduction) to add products to the store. Conversely, if the current user has permissions to add products to a store, but your app does not, your app will not be able to add products to the store. The only way your app can add products to a store is if both your app and the current user have permissions to do so." ],
"links": [],
"examples": [],
"extra":
Expand Down Expand Up @@ -99,8 +119,7 @@
"extra":
{ } },
{ "name": "navigate",
"labels":
[ "changed" ],
"labels": [],
"nameParams": [],
"params":
[ { "name": "destination",
Expand Down Expand Up @@ -684,8 +703,7 @@
"optional": true } ],
"extra":
{ },
"labels":
[ "changed" ] },
"labels": [] },
{ "name": "Document",
"locations":
[ { "lineno": 70,
Expand Down

0 comments on commit 15e9dab

Please sign in to comment.