Skip to content

Commit 35b0548

Browse files
authored
Merge pull request #743 from kenjis/fix-docs-authorization.md
docs: fix sample code in authorization.md
2 parents 22443d0 + 35c7362 commit 35b0548

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/authorization.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Groups are defined within the `Shield\Config\AuthGroups` config class.
3838

3939
```php
4040

41-
public $groups = [
41+
public array $groups = [
4242
'superadmin' => [
4343
'title' => 'Super Admin',
4444
'description' => 'Optional description of the group.',
@@ -56,7 +56,7 @@ When a user is first registered on the site, they are assigned to a default user
5656
`Config\AuthGroups::$defaultGroup`, and must match the name of one of the defined groups.
5757

5858
```php
59-
public $defaultGroup = 'users';
59+
public string $defaultGroup = 'user';
6060
```
6161

6262
## Defining Available Permissions
@@ -66,7 +66,7 @@ a scope and action, like `users.create`. The scope would be `users` and the acti
6666
can have a description for display within UIs if needed.
6767

6868
```php
69-
public $permissions = [
69+
public array $permissions = [
7070
'admin.access' => 'Can access the sites admin area',
7171
'admin.settings' => 'Can access the main site settings',
7272
'users.manage-admins' => 'Can manage other admins',
@@ -88,7 +88,7 @@ The matrix is an associative array with the group name as the key,
8888
and an array of permissions that should be applied to that group.
8989

9090
```php
91-
public $matrix = [
91+
public array $matrix = [
9292
'admin' => [
9393
'admin.access',
9494
'users.create', 'users.edit', 'users.delete',
@@ -100,7 +100,7 @@ public $matrix = [
100100
You can use a wildcard within a scope to allow all actions within that scope, by using a `*` in place of the action.
101101

102102
```php
103-
public $matrix = [
103+
public array $matrix = [
104104
'superadmin' => ['admin.*', 'users.*', 'beta.*'],
105105
];
106106
```

0 commit comments

Comments
 (0)