-
Notifications
You must be signed in to change notification settings - Fork 0
prepare version 2.0.0 #17
base: master
Are you sure you want to change the base?
Conversation
|
|
||
| ### Setup | ||
|
|
||
| 1. First, install the module using the [pos-cli](https://github.com/Platform-OS/pos-cli). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This steps looks like a duplication, as the previous ### Installation Steps section walks you through the installation.
|
|
||
| ### Setup | ||
|
|
||
| 1. First, install the module using the [pos-cli](https://github.com/Platform-OS/pos-cli). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 1. First, install the module using the [pos-cli](https://github.com/Platform-OS/pos-cli). | |
| 1. First, install the module using the [pos-cli](https://github.com/Platform-OS/pos-cli) if you haven't done so already. |
| - modules/components | ||
| ``` | ||
|
|
||
| 3. Configure [app/user.yml](https://documentation.platformos.com/developer-guide/users/user#adding-properties-to-the-user) file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 3. Configure [app/user.yml](https://documentation.platformos.com/developer-guide/users/user#adding-properties-to-the-user) file: | |
| 3. **Update the user configuration** in the [app/user.yml](https://documentation.platformos.com/developer-guide/users/user#adding-properties-to-the-user) file: |
|
|
||
| ``` | ||
|
|
||
| 4. Overwrite user's module permission file and add [admin_pages.view](https://github.com/Platform-OS/pos-module-admin/blob/master/modules/admin/public/views/pages/admin/index.liquid#L18) (and [admin.users.manage](https://github.com/Platform-OS/pos-module-user/blob/master/modules/user/public/lib/hooks/hook_admin_page.liquid) to access [manage users admin page defined in the user module](https://github.com/Platform-OS/pos-module-user/blob/master/modules/user/public/views/partials/admin_pages/list.liquid)) to the admin role. The links point to the implementation, which should allow you to understand how everything is wired together. Example permissions file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 4. Overwrite user's module permission file and add [admin_pages.view](https://github.com/Platform-OS/pos-module-admin/blob/master/modules/admin/public/views/pages/admin/index.liquid#L18) (and [admin.users.manage](https://github.com/Platform-OS/pos-module-user/blob/master/modules/user/public/lib/hooks/hook_admin_page.liquid) to access [manage users admin page defined in the user module](https://github.com/Platform-OS/pos-module-user/blob/master/modules/user/public/views/partials/admin_pages/list.liquid)) to the admin role. The links point to the implementation, which should allow you to understand how everything is wired together. Example permissions file: | |
| 4. Overwrite the user's module permission file and add the permissions for [admin_pages.view](https://github.com/Platform-OS/pos-module-admin/blob/master/modules/admin/public/views/pages/admin/index.liquid#L18) and [admin.users.manage](https://github.com/Platform-OS/pos-module-user/blob/master/modules/user/public/lib/hooks/hook_admin_page.liquid) to access the [manage users admin page defined in the user module](https://github.com/Platform-OS/pos-module-user/blob/master/modules/user/public/views/partials/admin_pages/list.liquid) to the admin role. The links point to the implementation, which should help you understand how everything is wired together. Here is an example permissions file: |
| {% return data %} | ||
| ``` | ||
|
|
||
| 5. Add `admin` role to the user you would like to make admin (or add [`superadmin` role to ensure they have access to everything, always). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 5. Add `admin` role to the user you would like to make admin (or add [`superadmin` role to ensure they have access to everything, always). | |
| 5. **Assign the `admin` role** to the user you want to grant admin access to, or add the `superadmin` role for full access. |
|
|
||
| If you want an admin page (or just a link) to show up in the admin navigation and the admin UI, you can implement `lib/hooks/hook_admin_page.liquid`. | ||
|
|
||
| It should return an array of objects describing the page and/or navigation items: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| It should return an array of objects describing the page and/or navigation items: | |
| This function should return an array of objects describing the page and/or navigation items: |
|
|
||
| ### hook_admin_layout | ||
|
|
||
| You can register your own admin layout file to provide a custom admin experience in your app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| You can register your own admin layout file to provide a custom admin experience in your app. | |
| You can register your own admin layout file to customize the admin experience in your app. |
|
|
||
| You can register your own admin layout file to provide a custom admin experience in your app. | ||
|
|
||
| This is how the [Theme Manager Module](https://github.com/Platform-OS/pos-module-theme-manager) implements admin themes, by looking for available admin theme implementations and registering the admin layout from the currently selected active theme. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| This is how the [Theme Manager Module](https://github.com/Platform-OS/pos-module-theme-manager) implements admin themes, by looking for available admin theme implementations and registering the admin layout from the currently selected active theme. | |
| The [Theme Manager Module](https://github.com/Platform-OS/pos-module-theme-manager) implements admin themes by searching for available admin theme implementations and registering the admin layout from the currently selected active theme. |
| This is how the [Theme Manager Module](https://github.com/Platform-OS/pos-module-theme-manager) implements admin themes, by looking for available admin theme implementations and registering the admin layout from the currently selected active theme. | ||
| The `admin_layou` hook simply returns the path of a liquid partial as a string. | ||
|
|
||
| The `admin_layout` hook simply returns the path of a liquid partial as a string. Example `lib/hooks/admin_layout_hook.liquid`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The `admin_layout` hook simply returns the path of a liquid partial as a string. Example `lib/hooks/admin_layout_hook.liquid`: | |
| The `admin_layout` hook returns the path of a liquid partial as a string. For example, in `lib/hooks/admin_layout_hook.liquid`: |
| {% return 'admin_layout' %} | ||
| ``` | ||
|
|
||
| Which will load `app/views/partials/admin_layout.liquid`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Which will load `app/views/partials/admin_layout.liquid`. | |
| This command loads `app/views/partials/admin_layout.liquid`. |
No description provided.