summaryrefslogtreecommitdiff
path: root/modules/forum
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2008-01-09 09:51:35 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2008-01-09 09:51:35 +0000
commit33f455d2df47ef80dd5b3c736762cecd23b0ba63 (patch)
treebb98ef555f3b1844b2043668c8539cfe99b71a8c /modules/forum
parent7de29914a9cbb6d82e4d5798f46565322e41b021 (diff)
downloadbrdo-33f455d2df47ef80dd5b3c736762cecd23b0ba63.tar.gz
brdo-33f455d2df47ef80dd5b3c736762cecd23b0ba63.tar.bz2
#153998 by David_Rothstein and myself: clean up permissions in book, blog, blogapi, forum and locale modules
Diffstat (limited to 'modules/forum')
-rw-r--r--modules/forum/forum.module17
1 files changed, 8 insertions, 9 deletions
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index 13ee02bd8..bfee9a9ce 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -305,14 +305,13 @@ function forum_node_info() {
* Implementation of hook_access().
*/
function forum_access($op, $node, $account) {
- if ($op == 'create') {
- return user_access('create forum topics', $account);
- }
-
- if ($op == 'update' || $op == 'delete') {
- if (user_access('edit any forum topic', $account) || (user_access('edit own forum topics', $account) && ($account->uid == $node->uid))) {
- return TRUE;
- }
+ switch ($op) {
+ case 'create':
+ return user_access('create forum topics', $account);
+ case 'update':
+ return user_access('edit any forum topic', $account) || (user_access('edit own forum topics', $account) && ($account->uid == $node->uid));
+ case 'delete':
+ return user_access('delete any forum topic', $account) || (user_access('delete own forum topics', $account) && ($account->uid == $node->uid));
}
}
@@ -320,7 +319,7 @@ function forum_access($op, $node, $account) {
* Implementation of hook_perm().
*/
function forum_perm() {
- return array('create forum topics', 'edit own forum topics', 'edit any forum topic', 'administer forums');
+ return array('create forum topics', 'delete own forum topics', 'delete any forum topic', 'edit own forum topics', 'edit any forum topic', 'administer forums');
}
/**