Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | ||
3 | /** | |
4 | * Implementation of hook_enable | |
5 | */ | |
6 | function civicrm_webtest_enable() { | |
b7c0a88f | 7 | user_role_grant_permissions(1, [ |
6a488035 TO |
8 | 'access CiviMail subscribe/unsubscribe pages', |
9 | 'access all custom data', | |
10 | 'access uploaded files', | |
11 | 'make online contributions', | |
12 | 'profile create', | |
13 | 'profile view', | |
14 | 'register for events', | |
b7c0a88f | 15 | ]); |
6a488035 TO |
16 | |
17 | $roles = user_roles(); | |
18 | if (!in_array('civicrm_webtest_user', $roles)) { | |
19 | $role = new stdClass(); | |
20 | $role->name = 'civicrm_webtest_user'; | |
21 | user_role_save($role); | |
22 | $rid = $role->rid; | |
b7c0a88f | 23 | } |
24 | else { | |
6a488035 TO |
25 | $rid = array_search('civicrm_webtest_user', $roles); |
26 | } | |
27 | ||
b7c0a88f | 28 | user_role_grant_permissions($rid, [ |
6a488035 | 29 | // FIXME: whoa, why do we bother with users if both need admin rights? |
b7c0a88f | 30 | 'access AJAX API', |
6a488035 | 31 | // 'access all cases and activities', |
b7c0a88f | 32 | 'access all custom data', |
33 | 'access CiviContribute', | |
34 | 'access CiviCRM', | |
35 | 'access CiviEvent', | |
36 | // 'access CiviGrant', | |
37 | 'access CiviMail', | |
38 | 'access CiviMail subscribe/unsubscribe pages', | |
39 | 'access CiviMember', | |
40 | 'access CiviPledge', | |
41 | 'access CiviReport', | |
42 | 'access Contact Dashboard', | |
43 | 'access contact reference fields', | |
44 | 'access deleted contacts', | |
45 | // 'access my cases and activities', | |
46 | 'access Report Criteria', | |
47 | 'save Report Criteria', | |
48 | 'access uploaded files', | |
49 | // 'add cases', | |
50 | 'add contacts', | |
51 | // 'administer CiviCase', | |
52 | 'administer CiviCRM', | |
53 | 'administer dedupe rules', | |
54 | 'administer Reports', | |
55 | 'administer reserved groups', | |
56 | 'administer reserved reports', | |
57 | 'administer reserved tags', | |
58 | 'administer Tagsets', | |
59 | 'delete activities', | |
60 | 'delete contacts', | |
61 | // 'delete in CiviCase', | |
62 | 'delete in CiviContribute', | |
63 | 'delete in CiviEvent', | |
64 | // 'delete in CiviGrant', | |
65 | 'delete in CiviMail', | |
66 | 'delete in CiviMember', | |
67 | 'delete in CiviPledge', | |
68 | 'edit all contacts', | |
69 | 'view my contact', | |
70 | 'edit my contact', | |
71 | 'edit all events', | |
72 | 'edit contributions', | |
73 | 'edit event participants', | |
74 | 'edit message templates', | |
75 | // 'edit grants', | |
76 | 'edit groups', | |
77 | 'edit memberships', | |
78 | 'edit pledges', | |
79 | 'import contacts', | |
80 | 'make online contributions', | |
81 | 'manage tags', | |
82 | 'merge duplicate contacts', | |
83 | 'profile create', | |
84 | 'profile edit', | |
85 | 'profile listings', | |
86 | 'profile listings and forms', | |
87 | 'profile view', | |
88 | 'register for events', | |
89 | 'translate CiviCRM', | |
90 | 'view all activities', | |
91 | 'view all contacts', | |
92 | 'view all notes', | |
93 | 'view event info', | |
94 | 'view event participants', | |
95 | 'view public CiviMail content', | |
96 | 'administer payment processors', | |
97 | 'create manual batch', | |
98 | 'edit own manual batches', | |
99 | 'edit all manual batches', | |
100 | 'view own manual batches', | |
101 | 'view all manual batches', | |
102 | 'delete own manual batches', | |
103 | 'delete all manual batches', | |
104 | 'export own manual batches', | |
105 | 'export all manual batches', | |
106 | ]); | |
6a488035 | 107 | } |