Skip to content

Commit 6d00994

Browse files
committed
Merge remote-tracking branch 'upstream/main' into integration-tests
2 parents f909286 + 8be34aa commit 6d00994

File tree

120 files changed

+13721
-1519
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+13721
-1519
lines changed

.github/workflows/deploy.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "🚀 - Deploy"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
name: "✏️ - Update content"
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: "🛸 - Pull latest content"
15+
uses: appleboy/ssh-action@master
16+
with:
17+
host: ${{ secrets.HOST }}
18+
username: ${{ secrets.USERNAME }}
19+
key: ${{ secrets.SSH_KEY }}
20+
script: |
21+
cd /var/www/share/devdocs.mage-os.org/devdocs
22+
./bin/checkout_latest_docs.sh
23+
php artisan optimize
24+
php artisan optimize:clear
25+
php artisan sitemap:generate
26+
php artisan optimize:clear

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Mage-OS Documentation
22

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

57
## Markup and Features

acl-xml.md

Whitespace-only changes.

acl.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# ACL XML Reference Documentation
2+
3+
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.
4+
5+
## 1. Introduction
6+
7+
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.
8+
9+
## 2. Structure of acl.xml
10+
11+
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:
12+
13+
```xml
14+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
15+
<acl>
16+
<!-- Define resources and roles here -->
17+
</acl>
18+
</config>
19+
```
20+
21+
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.
22+
23+
## 3. Defining Resources and Roles
24+
25+
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.
26+
27+
Here is an example of defining a resource and a role in acl.xml:
28+
29+
```xml
30+
<config>
31+
<acl>
32+
<resources>
33+
<resource id="Namespace_Module::resource_id" title="Resource Title" sortOrder="10">
34+
<!-- Define child resources here -->
35+
</resource>
36+
</resources>
37+
38+
<roles>
39+
<role id="Namespace_Module::role_id" title="Role Title" sortOrder="10">
40+
<!-- Define role's allowed resources here -->
41+
</role>
42+
</roles>
43+
</acl>
44+
</config>
45+
```
46+
47+
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`.
48+
49+
## 4. Applying ACL Permissions
50+
51+
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.
52+
53+
Here is an example of applying ACL permissions in acl.xml:
54+
55+
```xml
56+
<config>
57+
<acl>
58+
<resources>
59+
<resource id="Namespace_Module::resource_id" title="Resource Title" sortOrder="10">
60+
<resource id="Namespace_Module::child_resource_id" title="Child Resource Title" sortOrder="10">
61+
<permission id="Namespace_Module::permission_id" title="Permission Title" sortOrder="10"/>
62+
</resource>
63+
</resource>
64+
</resources>
65+
66+
<roles>
67+
<role id="Namespace_Module::role_id" title="Role Title" sortOrder="10">
68+
<resource id="Namespace_Module::resource_id" title="Resource Title">
69+
<resource id="Namespace_Module::child_resource_id" title="Child Resource Title">
70+
<permission id="Namespace_Module::permission_id" title="Permission Title" />
71+
</resource>
72+
</resource>
73+
</role>
74+
</roles>
75+
</acl>
76+
</config>
77+
```
78+
79+
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.
80+
81+
## 5. Examples
82+
83+
Here are a few examples to illustrate how to define resources, roles, and apply ACL permissions in acl.xml:
84+
85+
### Example 1: Defining a Resource
86+
87+
```xml
88+
<resources>
89+
<resource id="Namespace_Module::resource_id" title="Resource Title" sortOrder="10">
90+
<!-- Define child resources here -->
91+
</resource>
92+
</resources>
93+
```
94+
95+
### Example 2: Defining a Role
96+
97+
```xml
98+
<roles>
99+
<role id="Namespace_Module::role_id" title="Role Title" sortOrder="10">
100+
<!-- Define role's allowed resources here -->
101+
</role>
102+
</roles>
103+
```
104+
105+
### Example 3: Applying Permissions to a Role
106+
107+
```xml
108+
<roles>
109+
<role id="Namespace_Module::role_id" title="Role Title" sortOrder="10">
110+
<resource id="Namespace_Module::resource_id" title="Resource Title">
111+
<resource id="Namespace_Module::child_resource_id" title="Child Resource Title">
112+
<permission id="Namespace_Module::permission_id" title="Permission Title" />
113+
</resource>
114+
</resource>
115+
</role>
116+
</roles>
117+
```
118+
119+
## Conclusion
120+
121+
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.

acl_xml.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# `acl.xml` Reference Documentation
2+
3+
[TOC]
4+
5+
This reference documentation provides information on the structure and usage of the `acl.xml` file in Magento 2.
6+
`acl.xml` is an essential configuration file used to define Access Control List (ACL) permissions for various
7+
resources in your Magento 2 module or extension.
8+
9+
## Introduction
10+
11+
Access Control List (ACL) is a security mechanism used to control access to resources based on user roles and
12+
permissions. The `acl.xml` file is used in Magento 2 to define these roles, resources, and associated permissions for
13+
your module or extension.
14+
15+
## Structure of `acl.xml`
16+
17+
The `acl.xml` file follows a specific structure and should be placed in the `etc` directory of your module or extension.
18+
Here is an example of the basic structure of `acl.xml`:
19+
20+
```xml
21+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
22+
<acl>
23+
<!-- Define resources and roles here -->
24+
</acl>
25+
</config>
26+
```
27+
28+
The `xmlns:xsi` and `xsi:noNamespaceSchemaLocation` attributes define the XML schema for validation. The `<acl>` tag is
29+
the root element, under which you define resources and roles.
30+
31+
## Defining Resources and Roles
32+
33+
In the `<acl>` tag, you define `<resources>` and `<role>` elements to specify the resources and roles respectively. A
34+
resource represents a specific functionality or area in your module or extension, while a role represents a user role or
35+
group.
36+
37+
Here is an example of defining a resource and a role in `acl.xml`:
38+
39+
```xml
40+
<config>
41+
<acl>
42+
<resources>
43+
<resource id="Namespace_Module::resource_id" title="Resource Title" sortOrder="10">
44+
<!-- Define child resources here -->
45+
</resource>
46+
</resources>
47+
48+
<roles>
49+
<role id="Namespace_Module::role_id" title="Role Title" sortOrder="10">
50+
<!-- Define role's allowed resources here -->
51+
</role>
52+
</roles>
53+
</acl>
54+
</config>
55+
```
56+
57+
In the above example, the `<resource>` element defines a resource with an `id`, `title`, and `sortOrder`. The `id`
58+
should follow the format `<Namespace_Module>::<resource_id>`. Similarly, the `<role>` element defines a role with
59+
an `id`, `title`, and `sortOrder`.
60+
61+
## Applying ACL Permissions
62+
63+
Once you have defined resources and roles, you need to specify the permissions or access rules for each role on the
64+
respective resources. For this, you use the `<resource>` and `<permission>` elements.
65+
66+
Here is an example of applying ACL permissions in `acl.xml`:
67+
68+
```xml
69+
<config>
70+
<acl>
71+
<resources>
72+
<resource id="Namespace_Module::resource_id" title="Resource Title" sortOrder="10">
73+
<resource id="Namespace_Module::child_resource_id" title="Child Resource Title" sortOrder="10">
74+
<permission id="Namespace_Module::permission_id" title="Permission Title" sortOrder="10"/>
75+
</resource>
76+
</resource>
77+
</resources>
78+
79+
<roles>
80+
<role id="Namespace_Module::role_id" title="Role Title" sortOrder="10">
81+
<resource id="Namespace_Module::resource_id" title="Resource Title">
82+
<resource id="Namespace_Module::child_resource_id" title="Child Resource Title">
83+
<permission id="Namespace_Module::permission_id" title="Permission Title"/>
84+
</resource>
85+
</resource>
86+
</role>
87+
</roles>
88+
</acl>
89+
</config>
90+
```
91+
92+
In the above example, the `<permission>` element is nested under the appropriate `<resource>` and `<role>`. The `id`
93+
attribute follows the format `<Namespace_Module>::<permission_id>`. The `title` attribute provides a human-readable
94+
title for the permission.
95+
96+
## Conclusion
97+
98+
The `acl.xml` file is a crucial configuration file in Magento 2 for defining Access Control List (ACL) permissions. By
99+
understanding its structure and usage, you can control access to resources based on user roles and permissions
100+
effectively.

0 commit comments

Comments
 (0)