Skip to content

Commit

Permalink
Merge pull request #743 from kenjis/fix-docs-authorization.md
Browse files Browse the repository at this point in the history
docs: fix sample code in authorization.md
  • Loading branch information
kenjis committed May 16, 2023
2 parents 22443d0 + 35c7362 commit 35b0548
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Groups are defined within the `Shield\Config\AuthGroups` config class.

```php

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

```php
public $defaultGroup = 'users';
public string $defaultGroup = 'user';
```

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

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

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

```php
public $matrix = [
public array $matrix = [
'superadmin' => ['admin.*', 'users.*', 'beta.*'],
];
```
Expand Down

0 comments on commit 35b0548

Please sign in to comment.