This repository has been archived by the owner on Sep 25, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rsc_cite.install
62 lines (51 loc) · 1.59 KB
/
rsc_cite.install
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
<?php
/**
* Implements hook_install().
*/
function rsc_cite_install() {
module_load_include('inc','rsc_cite','rsc_cite.common');
/*
* Settings for content types
*/
rsc_cite_content_type_settings();
/*
* Set up the role and permissions for citation editors
*/
$rolename = 'rsc citation editor';
// Try to load the role to see if it exists
$role = user_role_load_by_name($rolename);
if (!$role) {
// create it, since it does not exist
$role = new stdClass();
$role->name = $rolename;
user_role_save($role);
// load the newly created role, to get the rid
$role = user_role_load_by_name($rolename);
}
// Assign the necessary permissions to citation editors
user_role_change_permissions($role->rid, array(
'access content overview' => true,
'access content' => true,
'view own unpublished content' => true,
'view revisions' => true,
'revert revisions' => true,
'delete revisions' => true,
'view the administration theme' => true,
'create rsc_cite_short content' => true,
'edit own rsc_cite_short content' => true,
'edit any rsc_cite_short content' => true,
'delete own rsc_cite_short content' => true,
'delete any rsc_cite_short content' => true,
'create rsc_cite_paragraph content' => true,
'edit own rsc_cite_paragraph content' => true,
'edit any rsc_cite_paragraph content' => true,
'delete own rsc_cite_paragraph content' => true,
'delete any rsc_cite_paragraph content' => true,
));
}
/**
* Implements hook_uninstall().
*/
function rsc_cite_uninstall() {
// TODO: remove variables
}