Skip to content
This repository was archived by the owner on Jul 7, 2025. It is now read-only.

Conversation

@Slashek
Copy link
Contributor

@Slashek Slashek commented Oct 13, 2024

No description provided.


### Setup

1. First, install the module using the [pos-cli](https://github.com/Platform-OS/pos-cli).

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).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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`:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Which will load `app/views/partials/admin_layout.liquid`.
This command loads `app/views/partials/admin_layout.liquid`.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants