Project

General

Profile

« Previous | Next » 

Revision 3e36c87c

Added by Andreas Kohlbecker almost 11 years ago

solving #3384 (Adapt cdm admin permissions to Drupal 7)

View differences:

7.x/modules/cdm_dataportal/cdm_dataportal.install
56 56
  _rename_variable('cdm_dataportal_show_media', 'cdm_images_include_children');
57 57
}
58 58

  
59
/**
60
 * update for RELEASE 3.2.1:
61
 *  - adding missing permissions for role CDM Admin
62
 */
63
function cdm_dataportal_update_7303() {
64
  $role = user_role_load_by_name('CDM admin');
65
  if(!$role){
66
    return "Role CDM admin not found, so the update is skipped.";
67
  }
68
  $new_permissions = array(
69
      'access extlinks content',
70
      'administer extlinks',
71
      'create url aliases',
72
      'delete any article content',
73
      'delete any page content',
74
      'delete own article content',
75
      'delete own page content',
76
      'delete revisions',
77
      'flush caches',
78
      'revert revisions',
79
      'use text format full_html',
80
      'view own unpublished content'
81
  );
82
  user_role_grant_permissions($role->rid, $new_permissions);
83

  
84
  return "adding missing permissions for role CDM Admin";
85
}
86

  
87

  
88

  
89

  
59 90
/**
60 91
 * Renames a persistent variable.
61 92
 *
7.x/modules/cdm_dataportal/profile/CDM_Portal/CDM_Portal.install
231 231
  // This because user_role_grant_permissions() will create the permission in the role_permision table if it does not
232 232
  // exist, and for that it needs to find a module that defines the permission (there is a module column in this table).
233 233
  $permissions = array(
234
    // Roles same as in D5 portals.
235 234
    'access administration menu',
235
    'access administration pages',
236
    'access content',
237
    'access content overview',
238
    'access extlinks content',
239
    'access site in maintenance mode',
236 240
    'administer blocks',
237 241
    'administer cdm_dataportal',
238
    'cdm_dataportal view notes',
239
    // @comment WA: Devel and IMCE modules are not required modules in this profile.
240
    // 'access devel information',
241
    // 'access imce',
242
    // 'administer imce',
243
    'administer menu',
244
    'access content',
245 242
    'administer content types',
243
    'administer extlinks',
244
    'administer menu',
246 245
    'administer nodes',
247
    'create page content',
248
    'edit own page content',
249
    'view revisions',
250
    'access administration pages',
251 246
    'administer site configuration',
247
    'administer themes',
252 248
    'administer users',
253

  
254
    // Roles as in D5 but with different name.
255
    'edit any page content',
256
    'edit any article content',
249
    'bypass node access',
250
    'cdm_dataportal view notes',
257 251
    'create article content',
252
    'create page content',
253
    'create url aliases',
254
    'delete any article content',
255
    'delete any page content',
256
    'delete own article content',
257
    'delete own page content',
258
    'delete revisions',
259
    'edit any article content',
260
    'edit any page content',
258 261
    'edit own article content',
259
    'administer themes',
260

  
261
    // New roles for D7.
262
    'access content overview',
263
    'access site in maintenance mode',
264
    'bypass node access',
265
    'view the administration theme',
266
    // 'use text format 3',
262
    'edit own page content',
263
    'flush caches',
264
    'revert revisions',
265
    'use text format full_html',
266
    'view own unpublished content',
267
    'view revisions',
268
    'view the administration theme'
269
    // Devel and IMCE modules are not yet required modules in this profile.
270
    // 'access devel information',
271
    // 'access imce',
272
    // 'administer imce',
267 273
  );
268 274
  user_role_grant_permissions($admin_role->rid, $permissions);
269 275

  

Also available in: Unified diff