summaryrefslogtreecommitdiff
path: root/modules/blog
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-10-11 16:37:43 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-10-11 16:37:43 +0000
commit0ada4f136a51b3e0a0098543fa4977f945728905 (patch)
treecbd9da419724f6e9aee59721f0d5147c1e389599 /modules/blog
parentfc599a7415f85840e21e4151b6025f089691531e (diff)
downloadbrdo-0ada4f136a51b3e0a0098543fa4977f945728905.tar.gz
brdo-0ada4f136a51b3e0a0098543fa4977f945728905.tar.bz2
#72487 by chx, pwolanin and moshe weitzman: let node_access() work on arbitrary users, so independent user access checks can be done in a request
Diffstat (limited to 'modules/blog')
-rw-r--r--modules/blog/blog.module8
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/blog/blog.module b/modules/blog/blog.module
index 8d1a08a42..2784d720d 100644
--- a/modules/blog/blog.module
+++ b/modules/blog/blog.module
@@ -29,15 +29,13 @@ function blog_perm() {
/**
* Implementation of hook_access().
*/
-function blog_access($op, $node) {
- global $user;
-
+function blog_access($op, $node, $account) {
if ($op == 'create') {
- return user_access('edit own blog') && $user->uid;
+ return user_access('edit own blog', $account) && $account->uid;
}
if ($op == 'update' || $op == 'delete') {
- if (user_access('edit own blog') && ($user->uid == $node->uid)) {
+ if (user_access('edit own blog', $account) && ($node->uid == $account->uid)) {
return TRUE;
}
}