Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into integration-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLambauer committed Aug 21, 2023
2 parents f909286 + 8be34aa commit 6d00994
Show file tree
Hide file tree
Showing 120 changed files with 13,721 additions and 1,519 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "🚀 - Deploy"

on:
push:
branches:
- main

jobs:
build:
name: "✏️ - Update content"
runs-on: ubuntu-latest

steps:
- name: "🛸 - Pull latest content"
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.SSH_KEY }}
script: |
cd /var/www/share/devdocs.mage-os.org/devdocs
./bin/checkout_latest_docs.sh
php artisan optimize
php artisan optimize:clear
php artisan sitemap:generate
php artisan optimize:clear
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Mage-OS Documentation

[TOC]

You can find the online version of the Mage-OS documentation at [https://devdocs.mage-os.org/](https://devdocs.mage-os.org)

## Markup and Features
Expand Down
Empty file removed acl-xml.md
Empty file.
121 changes: 121 additions & 0 deletions acl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# ACL XML Reference Documentation

This reference documentation provides information on the structure and usage of the acl.xml file in Magento 2. acl.xml is an essential configuration file used to define Access Control List (ACL) permissions for various resources in your Magento 2 module or extension.

## 1. Introduction

Access Control List (ACL) is a security mechanism used to control access to resources based on user roles and permissions. The acl.xml file is used in Magento 2 to define these roles, resources, and associated permissions for your module or extension.

## 2. Structure of acl.xml

The acl.xml file follows a specific structure and should be placed in the `etc` directory of your module or extension. Here is an example of the basic structure of acl.xml:

```xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
<acl>
<!-- Define resources and roles here -->
</acl>
</config>
```

The `xmlns:xsi` and `xsi:noNamespaceSchemaLocation` attributes define the XML schema for validation. The `<acl>` tag is the root element, under which you define resources and roles.

## 3. Defining Resources and Roles

In the `<acl>` tag, you define `<resources>` and `<role>` elements to specify the resources and roles respectively. A resource represents a specific functionality or area in your module or extension, while a role represents a user role or group.

Here is an example of defining a resource and a role in acl.xml:

```xml
<config>
<acl>
<resources>
<resource id="Namespace_Module::resource_id" title="Resource Title" sortOrder="10">
<!-- Define child resources here -->
</resource>
</resources>

<roles>
<role id="Namespace_Module::role_id" title="Role Title" sortOrder="10">
<!-- Define role's allowed resources here -->
</role>
</roles>
</acl>
</config>
```

In the above example, the `<resource>` element defines a resource with an `id`, `title`, and `sortOrder`. The `id` should follow the format `<Namespace_Module>::<resource_id>`. Similarly, the `<role>` element defines a role with an `id`, `title`, and `sortOrder`.

## 4. Applying ACL Permissions

Once you have defined resources and roles, you need to specify the permissions or access rules for each role on the respective resources. For this, you use the `<resource>` and `<permission>` elements.

Here is an example of applying ACL permissions in acl.xml:

```xml
<config>
<acl>
<resources>
<resource id="Namespace_Module::resource_id" title="Resource Title" sortOrder="10">
<resource id="Namespace_Module::child_resource_id" title="Child Resource Title" sortOrder="10">
<permission id="Namespace_Module::permission_id" title="Permission Title" sortOrder="10"/>
</resource>
</resource>
</resources>

<roles>
<role id="Namespace_Module::role_id" title="Role Title" sortOrder="10">
<resource id="Namespace_Module::resource_id" title="Resource Title">
<resource id="Namespace_Module::child_resource_id" title="Child Resource Title">
<permission id="Namespace_Module::permission_id" title="Permission Title" />
</resource>
</resource>
</role>
</roles>
</acl>
</config>
```

In the above example, the `<permission>` element is nested under the appropriate `<resource>` and `<role>`. The `id` attribute follows the format `<Namespace_Module>::<permission_id>`. The `title` attribute provides a human-readable title for the permission.

## 5. Examples

Here are a few examples to illustrate how to define resources, roles, and apply ACL permissions in acl.xml:

### Example 1: Defining a Resource

```xml
<resources>
<resource id="Namespace_Module::resource_id" title="Resource Title" sortOrder="10">
<!-- Define child resources here -->
</resource>
</resources>
```

### Example 2: Defining a Role

```xml
<roles>
<role id="Namespace_Module::role_id" title="Role Title" sortOrder="10">
<!-- Define role's allowed resources here -->
</role>
</roles>
```

### Example 3: Applying Permissions to a Role

```xml
<roles>
<role id="Namespace_Module::role_id" title="Role Title" sortOrder="10">
<resource id="Namespace_Module::resource_id" title="Resource Title">
<resource id="Namespace_Module::child_resource_id" title="Child Resource Title">
<permission id="Namespace_Module::permission_id" title="Permission Title" />
</resource>
</resource>
</role>
</roles>
```

## Conclusion

The acl.xml file is a crucial configuration file in Magento 2 for defining Access Control List (ACL) permissions. By understanding its structure and usage, you can control access to resources based on user roles and permissions effectively.
100 changes: 100 additions & 0 deletions acl_xml.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# `acl.xml` Reference Documentation

[TOC]

This reference documentation provides information on the structure and usage of the `acl.xml` file in Magento 2.
`acl.xml` is an essential configuration file used to define Access Control List (ACL) permissions for various
resources in your Magento 2 module or extension.

## Introduction

Access Control List (ACL) is a security mechanism used to control access to resources based on user roles and
permissions. The `acl.xml` file is used in Magento 2 to define these roles, resources, and associated permissions for
your module or extension.

## Structure of `acl.xml`

The `acl.xml` file follows a specific structure and should be placed in the `etc` directory of your module or extension.
Here is an example of the basic structure of `acl.xml`:

```xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
<acl>
<!-- Define resources and roles here -->
</acl>
</config>
```

The `xmlns:xsi` and `xsi:noNamespaceSchemaLocation` attributes define the XML schema for validation. The `<acl>` tag is
the root element, under which you define resources and roles.

## Defining Resources and Roles

In the `<acl>` tag, you define `<resources>` and `<role>` elements to specify the resources and roles respectively. A
resource represents a specific functionality or area in your module or extension, while a role represents a user role or
group.

Here is an example of defining a resource and a role in `acl.xml`:

```xml
<config>
<acl>
<resources>
<resource id="Namespace_Module::resource_id" title="Resource Title" sortOrder="10">
<!-- Define child resources here -->
</resource>
</resources>

<roles>
<role id="Namespace_Module::role_id" title="Role Title" sortOrder="10">
<!-- Define role's allowed resources here -->
</role>
</roles>
</acl>
</config>
```

In the above example, the `<resource>` element defines a resource with an `id`, `title`, and `sortOrder`. The `id`
should follow the format `<Namespace_Module>::<resource_id>`. Similarly, the `<role>` element defines a role with
an `id`, `title`, and `sortOrder`.

## Applying ACL Permissions

Once you have defined resources and roles, you need to specify the permissions or access rules for each role on the
respective resources. For this, you use the `<resource>` and `<permission>` elements.

Here is an example of applying ACL permissions in `acl.xml`:

```xml
<config>
<acl>
<resources>
<resource id="Namespace_Module::resource_id" title="Resource Title" sortOrder="10">
<resource id="Namespace_Module::child_resource_id" title="Child Resource Title" sortOrder="10">
<permission id="Namespace_Module::permission_id" title="Permission Title" sortOrder="10"/>
</resource>
</resource>
</resources>

<roles>
<role id="Namespace_Module::role_id" title="Role Title" sortOrder="10">
<resource id="Namespace_Module::resource_id" title="Resource Title">
<resource id="Namespace_Module::child_resource_id" title="Child Resource Title">
<permission id="Namespace_Module::permission_id" title="Permission Title"/>
</resource>
</resource>
</role>
</roles>
</acl>
</config>
```

In the above example, the `<permission>` element is nested under the appropriate `<resource>` and `<role>`. The `id`
attribute follows the format `<Namespace_Module>::<permission_id>`. The `title` attribute provides a human-readable
title for the permission.

## Conclusion

The `acl.xml` file is a crucial configuration file in Magento 2 for defining Access Control List (ACL) permissions. By
understanding its structure and usage, you can control access to resources based on user roles and permissions
effectively.
Loading

0 comments on commit 6d00994

Please sign in to comment.