generated from yardinternet/skeleton-package
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser-roles.php
105 lines (96 loc) · 2.49 KB
/
user-roles.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
declare(strict_types=1);
return [
/*
|--------------------------------------------------------------------------
| WordPress core roles
|--------------------------------------------------------------------------
|
| These are the default WordPress roles. You can disable them by setting the
| value to false. This will prevent the role from being created or updated.
|
*/
'core_roles' => [
'administrator' => true,
'editor' => true,
'author' => true,
'contributor' => true,
'subscriber' => true,
],
/*
|--------------------------------------------------------------------------
| Custom roles
|--------------------------------------------------------------------------
|
| Define custom roles here. Each role should have a display name. Capabilities,
| Post Type capabilities and capability groups can be assigned to a role.
| If you want to clone an existing role, you can specify the role to clone from
| and add or remove capabilities, Post Type capabilities and cap groups.
|
| Post Type capabilities are configured when registering a post type. These are
| capabilities like 'edit_{$post->post_type}', 'publish_{$post->post_type}',
| 'delete_{$post->post_type}', etc.
|
| If a post type is not registered in cli context you can add the post type capabilities
| manually by manually adding the capabilities to the Cap Groups.
|
*/
'prefix' => 'yard',
'roles' => [
'superuser' => [
'display_name' => 'Superuser',
'caps' => [
'my_custom_cap',
],
'post_type_caps' => [
'post',
],
'cap_groups' => [
'users',
'themes',
],
],
'visitor' => [
'display_name' => 'Visitor',
'clone' => [
'from' => 'subscriber',
'add' => [
'caps' => [],
'post_type_caps' => [],
'cap_groups' => [],
],
'remove' => [
'caps' => [],
'post_type_caps' => [],
'cap_groups' => [],
],
],
],
],
/*
|--------------------------------------------------------------------------
| Capability groups
|--------------------------------------------------------------------------
|
| Define groups of related capabilities to easily assign multiple capabilities
| to a role. These groups can be used in the 'cap_groups' property of a role.
|
*/
'cap_groups' => [
'users' => [
'create_users',
'delete_users',
'edit_users',
'list_users',
'promote_users',
'remove_users',
],
'themes' => [
'delete_themes',
'edit_themes',
'install_themes',
'switch_themes',
'update_themes',
],
],
];