Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
224
Merge Requests
224
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
6b116794
Commit
6b116794
authored
Aug 21, 2004
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#10084
: added 'edit own book page' permission: this makes the book
module consistent with the other node modules.
parent
03fa966c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
modules/book.module
modules/book.module
+4
-3
modules/book/book.module
modules/book/book.module
+4
-3
No files found.
modules/book.module
View file @
6b116794
...
...
@@ -17,7 +17,7 @@ function book_node_name($node) {
* Implementation of hook_perm().
*/
function
book_perm
()
{
return
array
(
'maintain books'
);
return
array
(
'maintain books'
,
'edit own book pages'
);
}
/**
...
...
@@ -31,7 +31,7 @@ function book_access($op, $node) {
// are still waiting for approval or not. We might not always want
// to display pages that are waiting for approval, but we take care
// of that problem in the book_content() function.
return
$node
->
status
;
return
(
$node
->
status
?
$node
->
status
:
(
$node
->
uid
==
$user
->
uid
&&
user_access
(
'edit own book pages'
)))
;
}
if
(
$op
==
'create'
)
{
...
...
@@ -48,7 +48,8 @@ function book_access($op, $node) {
// revision"-bit is set. That is, only updates that don't overwrite
// the current or pending information are allowed.
return
user_access
(
'maintain books'
)
&&
!
$node
->
moderate
&&
$node
->
revision
;
return
(
user_access
(
'maintain books'
)
&&
!
$node
->
moderate
&&
$node
->
revision
)
||
(
$node
->
uid
==
$user
->
uid
&&
user_access
(
'edit own book pages'
));
}
}
...
...
modules/book/book.module
View file @
6b116794
...
...
@@ -17,7 +17,7 @@ function book_node_name($node) {
* Implementation of hook_perm().
*/
function
book_perm
()
{
return
array
(
'maintain books'
);
return
array
(
'maintain books'
,
'edit own book pages'
);
}
/**
...
...
@@ -31,7 +31,7 @@ function book_access($op, $node) {
// are still waiting for approval or not. We might not always want
// to display pages that are waiting for approval, but we take care
// of that problem in the book_content() function.
return
$node
->
status
;
return
(
$node
->
status
?
$node
->
status
:
(
$node
->
uid
==
$user
->
uid
&&
user_access
(
'edit own book pages'
)))
;
}
if
(
$op
==
'create'
)
{
...
...
@@ -48,7 +48,8 @@ function book_access($op, $node) {
// revision"-bit is set. That is, only updates that don't overwrite
// the current or pending information are allowed.
return
user_access
(
'maintain books'
)
&&
!
$node
->
moderate
&&
$node
->
revision
;
return
(
user_access
(
'maintain books'
)
&&
!
$node
->
moderate
&&
$node
->
revision
)
||
(
$node
->
uid
==
$user
->
uid
&&
user_access
(
'edit own book pages'
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment