Active
Project:
Embedded Media Field
Version:
5.x-1.3
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Jan 2009 at 08:33 UTC
Updated:
22 Jan 2009 at 08:43 UTC
I would like to have a permission option to be able to give permission to change flickr key to some roles.
I need this because I am building a multisites "farm"; where I will create subsites for users and each subsite admin should be able to change their flickr key, despite they will not be uid=1 user.
This is easily achieved modifying very little code:
/**
* Implement hook_menu
*/
function emfield_menu($may_cache) {
$items = array();
if ($may_cache) {
$items[] = array(
'path' => 'admin/content/emfield',
'title' => t('Embedded Media Field configuration'),
'description' => t('Configure Embedded Media Field: Allow content types to use various 3rd party providers, enter API keys, etc.'),
'callback' => 'drupal_get_form',
'callback arguments' => 'emfield_settings',
// 'access' => user_access('administer site configuration'), // ?¿?¿ modified
'access' => user_access('administer embeded media field'), // ?¿?¿
);
$items[] = array(
'path' => 'admin/content/emfield/media',
'title' => t('Media settings'),
'description' => t('Configure Embedded Media Field: Allow content types to use various 3rd party providers, enter API keys, etc.'),
'callback' => 'drupal_get_form',
'callback arguments' => 'emfield_settings',
'access' => user_access('administer site configuration'),
'type' => MENU_DEFAULT_LOCAL_TASK,
);
}
return $items;
}
//?¿?¿ added
function emfield_perm() {
return array('administer embeded media field');
}
Comments
Comment #1
enboig commentedI forgot to change the second "'access' => user_access('administer site configuration'),"; but the idea is here.
Having it in the "oficial" module would avoid me to have to remember about this every update I do, and it may also be usefull to other users.