Skip to content
Snippets Groups Projects
Commit bd1f122c authored by git's avatar git Committed by Lachlan Ennis
Browse files

Issue #2939169 by nikitaaswani: Implement hook_permission

parent df8c52cf
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,18 @@ function extlink_help($path, $arg) {
}
}
/**
* Implements hook_permission().
*/
function extlink_permission() {
return array(
'administer external link' => array(
'title' => t('Administer External Links'),
'description' => t('Configure external links.'),
),
);
}
/**
* Implements hook_menu().
*/
......@@ -28,7 +40,7 @@ function extlink_menu() {
'page callback' => 'drupal_get_form',
'page arguments' => array('extlink_admin_settings'),
'access callback' => 'user_access',
'access arguments' => array('administer site configuration'),
'access arguments' => array('administer external link'),
);
return $items;
}
......
......@@ -37,7 +37,7 @@ class ExtlinkBaseWebTestCase extends DrupalWebTestCase {
// Enable any module that you will need in your tests.
parent::setUp('extlink');
// Create a normal user.
// Create a normal user without permission.
$permissions = array(
'access comments', 'post comments', 'skip comment approval',
'access content', 'create page content', 'edit own page content',
......@@ -45,9 +45,7 @@ class ExtlinkBaseWebTestCase extends DrupalWebTestCase {
$this->normalUser = $this->drupalCreateUser($permissions);
// Create an admin user.
$permissions[] = 'administer site configuration';
$permissions[] = 'administer permissions';
$permissions[] = 'administer content types';
$permissions[] = 'administer external link';
$this->adminUser = $this->drupalCreateUser($permissions);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment