I wanted to add a "global moderator" type of role but I couldn't find an access option for editing blogs. So I hacked blog.module adding the option I required.
Since I am new to Drupal development could you review my small changes and tell me if my modifications are correct/make sense?
I would also like to know what you would do to get over this problem.
Thanks! :)
| Comment | File | Size | Author |
|---|---|---|---|
| blog.module_administer_option.patch | 721 bytes | foutrelis |
Comments
Comment #1
dmitrig01 commentedIt's called "edit blog nodes"
Comment #2
foutrelis commentedAnd where would that be?
There is no "edit blog nodes" in my admin/user/access. I also don't see it implemented in the blog.module.
/**
* Implementation of hook_perm().
*/
function blog_perm() {
return array('edit own blog');
}
/**
* Implementation of hook_access().
*/
function blog_access($op, $node) {
global $user;
if ($op == 'create') {
return user_access('edit own blog') && $user->uid;
}
if ($op == 'update' || $op == 'delete') {
if (user_access('edit own blog') && ($user->uid == $node->uid)) {
return TRUE;
}
}
}