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/book/v6/how-to/authorization.md
+15-16Lines changed: 15 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,28 +1,27 @@
1
1
# Authorization Guards
2
2
3
-
The packages responsible for restricting access to certain parts of the application are [dot-rbac-guard](https://github.com/dotkernel/dot-rbac-guard) and [dot-rbac](https://github.com/dotkernel/dot-rbac).
4
-
These packages work together to create an infrastructure that is customizable and diversified to manage user access to the platform by specifying the type of role the user has.
3
+
The packages responsible for restricting access to certain parts of the application are [dot-rbac-guard](https://github.com/dotkernel/dot-rbac-guard) and [dot-rbac](https://github.com/dotkernel/dot-rbac). These packages work together to create an infrastructure that is customizable and diversified to manage user access to the platform by specifying the type of role the user has.
5
4
6
5
The `authorization.global.php` file provides multiple configurations specifying multiple roles as well as the types of permissions to which these roles have access.
7
6
8
7
```php
9
8
//example of a flat RBAC model that specifies two types of roles as well as their permission
10
9
'roles' => [
11
-
'admin' => [
12
-
'permissions' => [
13
-
'authenticated',
14
-
'edit',
15
-
'delete',
16
-
//etc..
17
-
]
18
-
],
19
-
'user' => [
20
-
'permissions' => [
21
-
'authenticated',
22
-
//etc..
23
-
]
24
-
]
10
+
'admin' => [
11
+
'permissions' => [
12
+
'authenticated',
13
+
'edit',
14
+
'delete',
15
+
//etc..
25
16
]
17
+
],
18
+
'user' => [
19
+
'permissions' => [
20
+
'authenticated',
21
+
//etc..
22
+
]
23
+
]
24
+
]
26
25
```
27
26
28
27
The `authorization-guards.global.php` file defines which permissions are required to access specific route handlers. These permissions must first be declared in the authorization.global.php (dot-rbac) configuration file.
Copy file name to clipboardExpand all lines: docs/book/v6/how-to/creating-fixtures.md
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,7 @@
2
2
3
3
> Fixtures are used to seed the database with initial values and should only be executed ONCE each, after migrating the database.
4
4
5
-
Seeding the database is done with the help of our custom package `dotkernel/dot-data-fixtures` built on top of `doctrine/data-fixtures`.
6
-
See below on how to use our CLI command for listing and executing Doctrine data fixtures.
5
+
Seeding the database is done with the help of our custom package `dotkernel/dot-data-fixtures` built on top of `doctrine/data-fixtures`. See below on how to use our CLI command for listing and executing Doctrine data fixtures.
7
6
8
7
## Working with fixtures
9
8
@@ -12,19 +11,19 @@ You can find an example of a fixtures class in `src/Core/src/App/src/Fixture/Adm
12
11
To list all the available fixtures by order of execution run:
13
12
14
13
```shell
15
-
php bin/doctrine fixtures:list
14
+
php ./bin/doctrine fixtures:list
16
15
```
17
16
18
17
To execute all fixtures run:
19
18
20
19
```shell
21
-
php bin/doctrine fixtures:execute
20
+
php ./bin/doctrine fixtures:execute
22
21
```
23
22
24
23
To execute a specific fixture, use its class name, like in this example:
where `exampleCsrf` must match the CSRF field's name in the form.
@@ -50,28 +50,23 @@ where `exampleCsrf` must match the CSRF field's name in the form.
50
50
51
51
### Render field
52
52
53
-
Open the template that renders your form and add the following code somewhere between the form's opening and closing
54
-
tags:
53
+
Open the template that renders your form and add the following code somewhere between the form's opening and closing tags:
55
54
56
55
```text
57
56
{{ formElement(form.get('exampleCsrf')) }}
58
57
```
59
58
60
59
## Test the implementation
61
60
62
-
Access your form from the browser and view its source. You should see a new hidden field, called `exampleCsrf` (or
63
-
however you named it). After filling out the form, submitting it should work as before.
61
+
Access your form from the browser and view its source. You should see a new hidden field, called `exampleCsrf` (or however you named it). After filling out the form, submitting it should work as before.
64
62
65
-
In order to make sure that the new CSRF field works as expected, you can inspect the form using your browser's
66
-
`Developer tools` and modify its value in any way. Submitting a filled out form should result in a validation error:
63
+
In order to make sure that the new CSRF field works as expected, you can inspect the form using your browser's `Developer tools` and modify its value in any way. Submitting a filled out form should result in a validation error:
67
64
68
65
> This field is required and cannot be empty.
69
66
70
67
### Timeout
71
68
72
-
Note the `timeout` option in your PHP form's `exampleCsrf` field, with its default value set to **3600**. This
73
-
represents the value in seconds for how long the token is valid. Submitting a form that has been rendered for longer
74
-
than this value will result in a validation error:
69
+
Note the `timeout` option in your PHP form's `exampleCsrf` field, with its default value set to **3600**. This represents the value in seconds for how long the token is valid. Submitting a form that has been rendered for longer than this value will result in a validation error:
The next step is to register the class in the `ConfigProvider` under `factories` using `Dot\DependencyInjection\Factory\AttributedServiceFactory::class`.
Copy file name to clipboardExpand all lines: docs/book/v6/installation/configuration-files.md
+2-10Lines changed: 2 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,7 @@
5
5
> If you intend to send emails from your Frontend, make sure to fill in SMTP connection params.
6
6
> This will be covered in the next section.
7
7
8
-
> **optional**: in order to run/create tests, duplicate `config/autoload/local.test.php.dist` as `config/autoload/local.test.php`
9
-
> this creates a new in-memory database that your tests will run on.
8
+
> **optional**: in order to run/create tests, duplicate `config/autoload/local.test.php.dist` as `config/autoload/local.test.php` this creates a new in-memory database that your tests will run on.
10
9
11
10
If you want your application to send mail, add valid credentials to the following keys in `config/autoload/mail.global.php`
12
11
@@ -15,13 +14,6 @@ Under `message_options` key:
15
14
-`from` - email address that will send emails (required)
16
15
-`from_name` - organization name for signing sent emails (optional)
17
16
18
-
Under `smtp_options` key:
19
-
20
-
-`host` - hostname or IP address of the mail server (required)
21
-
-`connection_config` - add the `username` and `password` keys (required)
22
-
23
-
In `config/autoload/local.php` edit the key `contact` => `message_receivers` => `to` with *string* values for emails that should receive contact messages.
24
-
25
17
> **Please add at least 1 email address in order for contact message to reach someone**
26
18
27
-
Also feel free to add as many CCs as you require under the `contact` => `message_receivers` => `cc` key.
19
+
Also feel free to add as many CCs as you require under the `dot_mail` => `default` => `message_options` => `cc` key.
Copy file name to clipboardExpand all lines: docs/book/v6/installation/doctrine-orm.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
@@ -33,21 +33,21 @@ $databases = [
33
33
Run the database migrations by using the following command:
34
34
35
35
```shell
36
-
php vendor/bin/doctrine-migrations migrate
36
+
php ./vendor/bin/doctrine-migrations migrate
37
37
```
38
38
39
-
Note: If you have already run the migrations, you may get this message.
40
-
You should double-check to make sure the new migrations are ok to run.
39
+
>If you have already run the migrations, you may get this message.
40
+
> You should double-check to make sure the new migrations are ok to run.
41
41
42
-
```shell
42
+
```text
43
43
WARNING! You have x previously executed migrations in the database that are not registered migrations.
44
44
{migration list}
45
45
Are you sure you wish to continue? (y/n)
46
46
```
47
47
48
48
When using an empty database, you will get this confirmation message instead.
49
49
50
-
```shell
50
+
```text
51
51
WARNING! You are about to execute a migration in database "<your_database_name>" that could result in schema changes and data loss. Are you sure you wish to continue? (yes/no)
52
52
```
53
53
@@ -56,7 +56,7 @@ Each migration will be logged in the `migrations` table to prevent running the s
56
56
57
57
If everything ran correctly, you will get this confirmation.
58
58
59
-
```shell
59
+
```text
60
60
[OK] Successfully migrated to version: Core\App\Migration\Version20250407142911
61
61
```
62
62
@@ -67,7 +67,7 @@ If everything ran correctly, you will get this confirmation.
67
67
Run this command to populate the admin tables with the default values:
68
68
69
69
```shell
70
-
php bin/doctrine fixtures:execute
70
+
php ./bin/doctrine fixtures:execute
71
71
```
72
72
73
73
You should see our galloping horse in the command line.
**Tip**: If you set up the synchronizer command as a cronjob, you can add the `-q|--quiet` option, and it will output data only if an error has occurred.
31
+
>If you set up the synchronizer command as a cronjob, you can add the `-q|--quiet` option, and it will output data only if an error has occurred.
Copy file name to clipboardExpand all lines: docs/book/v6/installation/test-the-installation.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
@@ -4,18 +4,18 @@
4
4
5
5
We recommend running your applications in WSL:
6
6
7
-
- Make sure you have [WSL](https://github.com/dotkernel/development/blob/main/wsl/README.md) installed on your system.
8
-
- Currently we provide a distro implementations for [AlmaLinux9](https://github.com/dotkernel/development/blob/main/wsl/os/almalinux9/README.md).
7
+
- Make sure you have [WSL2](https://docs.dotkernel.org/development/v2/setup/system-requirements/) installed on your system.
8
+
- Currently we provide a distro implementations for [AlmaLinux9](https://github.com/dotkernel/development/blob/main/wsl/README.md).
9
9
- Install the application in a virtualhost as recommended by the chosen distro.
10
10
- Set `$baseUrl` in **config/autoload/local.php** to the address of the virtualhost.
11
11
- Run the application by opening the virtualhost address in your browser.
12
12
13
-
You should see the `Dotkernel admin` login page.
13
+
You should see the `Dotkernel Admin` login page.
14
14
15
15
> If you are getting exceptions or errors regarding some missing services, try running the following command:
16
16
17
17
```shell
18
-
sudo php bin/clear-config-cache.php
18
+
sudo php ./bin/clear-config-cache.php
19
19
```
20
20
21
21
> If `config-cache.php` is present that config will be loaded regardless of the `ConfigAggregator::ENABLE_CACHE` in `config/autoload/mezzio.global.php`
@@ -40,4 +40,4 @@ return [
40
40
];
41
41
```
42
42
43
-
Do not change this in `local.php.dist` as well because this value should remain `true` on production.
43
+
> Do not change this in `local.php.dist` as well because this value should remain `true` on production.
0 commit comments