Skip to content

Commit

Permalink
Fix: Dont default navigation page permissions to admin (#1243)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackw authored Oct 28, 2024
1 parent 8aa0648 commit 6935062
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
7 changes: 6 additions & 1 deletion docusaurus/docs/tutorials/build-an-app-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ Let's add a new page to the navigation menu:
"type": "page",
"name": "New Page",
"path": "/a/%PLUGIN_ID%/new-page",
"roles": "Admin",
"addToNav": true,
"defaultNav": false
}
Expand Down Expand Up @@ -120,6 +119,12 @@ The new page appears in the navigation menu. You can now edit the React router i

You don't need to register all your pages inside `includes` in your `plugin.json`. Register only pages that you want to add to the navigation menu.

:::tip

You can limit which users have access to pages in the navigation menu by using the [`role`](/reference/plugin-json#properties-7) property.

:::

:::note

You can only have one level of pages in the navigation menu. Sub-menu items are not supported.
Expand Down
4 changes: 0 additions & 4 deletions packages/create-plugin/templates/app/src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,27 @@
"type": "page",
"name": "Page One",
"path": "/a/%PLUGIN_ID%/one",
"role": "Admin",
"addToNav": true,
"defaultNav": true
},
{
"type": "page",
"name": "Page Two",
"path": "/a/%PLUGIN_ID%/two",
"role": "Admin",
"addToNav": true,
"defaultNav": false
},
{
"type": "page",
"name": "Page Three",
"path": "/a/%PLUGIN_ID%/three",
"role": "Admin",
"addToNav": true,
"defaultNav": false
},
{
"type": "page",
"name": "Page Four",
"path": "/a/%PLUGIN_ID%/four",
"role": "Admin",
"addToNav": true,
"defaultNav": false
},
Expand Down
4 changes: 0 additions & 4 deletions packages/create-plugin/templates/scenes-app/src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,27 @@
"type": "page",
"name": "Home",
"path": "/a/%PLUGIN_ID%/home",
"role": "Admin",
"addToNav": true,
"defaultNav": true
},
{
"type": "page",
"name": "Page with tabs",
"path": "/a/%PLUGIN_ID%/page-with-tabs",
"role": "Admin",
"addToNav": true,
"defaultNav": false
},
{
"type": "page",
"name": "Page with drilldown",
"path": "/a/%PLUGIN_ID%/page-with-drilldown",
"role": "Admin",
"addToNav": true,
"defaultNav": false
},
{
"type": "page",
"name": "Hello world",
"path": "/a/%PLUGIN_ID%/hello-world",
"role": "Admin",
"addToNav": true,
"defaultNav": false
}
Expand Down

0 comments on commit 6935062

Please sign in to comment.