Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
extlink-3172378
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
extlink-3172378
Commits
bd1f122c
Commit
bd1f122c
authored
6 years ago
by
git
Committed by
Lachlan Ennis
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2939169
by nikitaaswani: Implement hook_permission
parent
df8c52cf
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
extlink.module
+13
-1
13 additions, 1 deletion
extlink.module
extlink.test
+2
-4
2 additions, 4 deletions
extlink.test
with
15 additions
and
5 deletions
extlink.module
+
13
−
1
View file @
bd1f122c
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
extlink.test
+
2
−
4
View file @
bd1f122c
...
...
@@ -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
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment