Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3443488
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
drupal-3443488
Commits
da794083
Commit
da794083
authored
15 years ago
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
- Patch
#491490
by torelad: updated hook_perm() documentation.
parent
b6553856
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/system/system.api.php
+8
-3
8 additions, 3 deletions
modules/system/system.api.php
with
8 additions
and
3 deletions
modules/system/system.api.php
+
8
−
3
View file @
da794083
...
...
@@ -551,11 +551,13 @@ function hook_system_info_alter(&$info, $file) {
* Define user permissions.
*
* This hook can supply permissions that the module defines, so that they
* can be selected on the user permissions page and used to restrict
* can be selected on the user permissions page and used to
grant or
restrict
* access to actions the module performs.
*
* @return
* An array of which permission names are the keys and their corresponding value is a description of the permission
* An array of permissions where the permission name is the array key and the
* corresponding key value is an array of key/value pairs specifying
* the permission's title and description
*
* The permissions in the array do not need to be wrapped with the function t(),
* since the string extractor takes care of extracting permission names defined in the perm hook for translation.
...
...
@@ -566,7 +568,10 @@ function hook_system_info_alter(&$info, $file) {
*/
function
hook_perm
()
{
return
array
(
'administer my module'
=>
t
(
'Perform maintenance tasks for my module'
),
'administer my module'
=>
array
(
'title'
=>
t
(
'Administer my module'
),
'description'
=>
t
(
'Perform administration tasks for my module.'
),
),
);
}
...
...
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