You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/acl.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ In this example, a [Role][acl-role] indicates who needs access to a specific [Co
38
38
Using the [Phalcon\Acl][acl-acl] component, you can establish associations between these [Roles][acl-role] and [Components][acl-component], enhancing the application's security by allowing only specific roles to access designated components.
39
39
40
40
## Activation
41
-
[Phalcon\Acl][acl-acl]relies on adapters to manage roles and components. Presently, the only available adapter is [Phalcon\Acl\Adapter\Memory][acl-adapter-memory]. While using the memory adapter significantly enhances ACL access speed, it comes with the trade-off of non-persistent memory. Therefore, developers need to implement a storage strategy for ACL data to avoid regenerating the ACL at every request. This is particularly crucial for large ACLs stored in a database or file system.
41
+
[Phalcon\Acl][acl-acl]uses adapters to manage roles and components. Currently the built-in adapter is [Phalcon\Acl\Adapter\Memory][acl-adapter-memory]. The memory adapter is fast but non-persistent, so you should persist the ACL (cache or file) in production to avoid rebuilding it on every request.
42
42
43
43
The [Phalcon\Acl][acl-acl] constructor takes an adapter as its first parameter for retrieving information related to the control list.
44
44
@@ -110,7 +110,7 @@ $acl->addRole('guest');
110
110
```
111
111
112
112
## Adding Components
113
-
A [Component][acl-component] in the context of Phalcon\Acl represents an area of the application where access is controlled. In an MVC application, this typically corresponds to a Controller. Although it is not mandatory, you can use the [Phalcon\Acl\Component][acl-component] class to define components in the application. It is important to add related actions to a component so that the ACL understands what it should control.
113
+
A [Component][acl-component] in the context of Phalcon\Acl represents an area of the application where access is controlled. In an MVC application, this typically corresponds to a Controller. Although not required, you can use the [Phalcon\Acl\Component][acl-component] class to define components in the application. It is important to add related actions to a component so that the ACL understands what it should control.
*`$acl->allow('*', 'session', '*');`: Wildcards can be used for mass matching roles, components, or actions. This line allows every role to access every action in the `session` component.
235
237
*`$acl->allow('*', '*', 'view');`: This line gives access to the `view` action to every role. In MVC terms, it allows any role to access any controller that exposes a `viewAction`.
236
238
*`$acl->deny('guest', '*', 'view');`: For the `guest` role, deny access to all components with the `view` action. Despite the default access level being `Acl\Enum::DENY`, this line specifically denies the `view` action to all roles and components. It ensures that the `guest` role only has access to the `session` component and the `login` and `logout` actions since guests are not logged into the application.
237
-
*`$acl->allow('*', '*', 'view');`: This line gives access to the `view` action to every role. However, the following line excludes the `guest` role from that access:
238
-
239
-
```php
240
-
$acl->deny('guest', '*', 'view');
241
-
```
239
+
*`$acl->allow('*', '*', 'view');`: This line gives access to the `view` action to every role.
240
+
*`$acl->deny('guest', '*', 'view');`: This line excludes the `guest` role from the `view` access:
242
241
243
-
!!! danger "NOTE"
242
+
!!! danger "DANGER"
244
243
245
244
Please be **VERY** careful when using the `*` wildcard. It is very easy to make a mistake and the wildcard, although it seems convenient, it may allow users to access areas of your application that they are not supposed to. The best way to be 100% sure is to write tests specifically to test the permissions and the ACL. These can be done in the `unit` test suite by instantiating the component and then checking the `isAllowed()` if it is `true` or `false`.
246
245
@@ -665,7 +664,7 @@ if ($acl->isAllowed('manager', 'admin', 'dashboard')) {
665
664
}
666
665
```
667
666
668
-
It is a good practice to not use serialization of the ACL during development to ensure that your ACL is rebuilt with every request, while other adapters or means of serializing and storing the ACL in production.
667
+
It is a good practice to not serialize the ACL during development to ensure that your ACL is rebuilt with every request, while other adapters or means of serializing and storing the ACL in production.
669
668
670
669
## Events
671
670
[Phalcon\Acl][acl-acl] can work in conjunction with the [Events Manager][events] if present, to fire events to your application. Events are triggered using the type `acl`. Events that return `false` can stop the active role. The following events are available:
Copy file name to clipboardExpand all lines: docs/application-micro.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ $container = new Di();
36
36
$app = new Micro($container);
37
37
```
38
38
39
-
!!! warning "NOTE"
39
+
!!! warning "WARNING"
40
40
41
41
Starting from Phalcon v5.3.0, the `Micro` object is no longer automatically registered in the dependency injection container with the name `application`. Developers are required to manage the application instance explicitly.
42
42
@@ -308,7 +308,7 @@ Defining routes in a [Phalcon\Mvc\Micro][mvc-micro] application is straightforwa
308
308
### Activation
309
309
Routing is managed by the [Phalcon\Mvc\Router][mvc-router] object.
The name that we bind each route has a suffix of `Action`. This is not necessary, your method can be called anything you like.
1000
1000
@@ -1655,7 +1655,7 @@ Middleware can be attached to a Micro application in three different events:
1655
1655
|`after`| After the handler has been executed |
1656
1656
|`finish`| After the response has been sent to the caller |
1657
1657
1658
-
!!! warning "NOTE"
1658
+
!!! warning "WARNING"
1659
1659
1660
1660
Multiple middleware classes can be attached to each of the above events, and they will be executed sequentially when the relevant event fires.
1661
1661
@@ -2199,7 +2199,7 @@ class RequestMiddleware implements MiddlewareInterface
2199
2199
2200
2200
This middleware is responsible for manipulating our response and sending it back to the caller as a JSON string. Therefore, we need to attach it to the `after` event of our Micro application.
2201
2201
2202
-
!!! warning "NOTE"
2202
+
!!! warning "WARNING"
2203
2203
2204
2204
We are using the `call` method for this middleware since we have nearly executed the whole request cycle.
2205
2205
@@ -2246,7 +2246,7 @@ class ResponseMiddleware implements MiddlewareInterface
2246
2246
2247
2247
Models can be utilized in Micro applications by instructing the application on how to find the relevant classes through an autoloader.
2248
2248
2249
-
!!! warning "NOTE"
2249
+
!!! warning "WARNING"
2250
2250
2251
2251
The relevant `db` service must be registered in your DI container.
2252
2252
@@ -2364,7 +2364,7 @@ $app->get(
2364
2364
);
2365
2365
```
2366
2366
2367
-
!!! warning "NOTE"
2367
+
!!! warning "WARNING"
2368
2368
2369
2369
The above example uses the [Phalcon\Mvc\View\Simple][mvc-view-simple] component, which uses relative paths instead of controllers and actions. You can use the [Phalcon\Mvc\View][mvc-view] component instead, but to do so, you will need to change the parameters passed to `render()`.
If the keys from your data contain special characters such as `.` or `-`, and you choose to use the same character for your delimiter when using the `path()` method, you will not get the desired results back, since `path()` will interpret the delimiter as a new nested level.
Copy file name to clipboardExpand all lines: docs/contributions.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,11 +17,11 @@ When you create a pull request, we have a handy template to help you describe wh
17
17
* put on hold, if a discussion is necessary (community, core team etc.)
18
18
* rejected
19
19
20
-
!!! warning "NOTE"
20
+
!!! warning "WARNING"
21
21
22
22
If your pull request is a new feature, it is best to discuss it with the core team first, to ensure that it will align with the evolution of the framework.
23
23
24
-
!!! danger "NOTE"
24
+
!!! danger "DANGER"
25
25
26
26
Please make sure that the target branch that you send your pull request is correct and that you have already rebased your code. Pull requests to the **master** branch are not allowed
27
27
@@ -35,7 +35,7 @@ We have removed the translations from v5.5.x onward. There was not that much tra
35
35
36
36
## Questions and Support
37
37
38
-
!!! danger "NOTE"
38
+
!!! danger "DANGER"
39
39
40
40
We only accept bug reports, new feature requests and pull requests in GitHub. For questions regarding the usage of the framework or support requests please visit the [official discussions page][phalcon-discussions] or our [Discord][phalcon-discord] server.
Copy file name to clipboardExpand all lines: docs/controllers.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,11 +92,11 @@ class InvoicesController extends Controller
92
92
}
93
93
```
94
94
95
-
!!! warning "NOTE"
95
+
!!! warning "WARNING"
96
96
97
97
The use of the `__construct()` method is not recommended.
98
98
99
-
!!! warning "NOTE"
99
+
!!! warning "WARNING"
100
100
101
101
The `initialize()` method is only called if the `beforeExecuteRoute` event has been executed successfully. This is to ensure that if you have authorization checking code in the event, `initialize` will never be invoked
102
102
@@ -116,7 +116,7 @@ class InvoicesController extends Controller
116
116
}
117
117
```
118
118
119
-
!!! warning "NOTE"
119
+
!!! warning "WARNING"
120
120
121
121
Note that `onConstruct()` is executed even if the action to be executed does not exist in the controller or the user does not have access to it (assuming custom access control is implemented in the application).
122
122
@@ -245,7 +245,7 @@ class InvoicesController extends Controller
245
245
}
246
246
```
247
247
248
-
!!! warning "NOTE"
248
+
!!! warning "WARNING"
249
249
250
250
You will need to add additional code to ensure that the data passed is of the correct type and either use the default value or have a correct value. If not, you will end up with errors.
Copy file name to clipboardExpand all lines: docs/datamapper.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
6
6
These components have been heavily influenced by [Aura PHP][auraphp] and [Atlas PHP][atlasphp]
7
7
8
-
!!! warning "NOTE"
8
+
!!! warning "WARNING"
9
9
10
10
The full implementation of a DataMapper is not yet complete. There are however a few components that can be used in any project, such as the `Connection` and `Query/Select`
11
11
@@ -2461,7 +2461,7 @@ $update->perform();
2461
2461
// inv_status_flag = :inv_status_flag
2462
2462
```
2463
2463
2464
-
!!! warning "NOTE"
2464
+
!!! warning "WARNING"
2465
2465
2466
2466
Using the `columns()` method you are not able to set the type of each parameter.
0 commit comments