diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-06-08 06:26:27 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-06-08 06:26:27 -0400 |
commit | 9410b63bbc819955964706c876bc2f7ecea10adf (patch) | |
tree | 81f1105f704d435597c0218ddd22e234d92c2e5b /include/wiki.php | |
parent | d43a81438585f4fa188a13b96480dd3b38f13f89 (diff) | |
download | volse-hubzilla-9410b63bbc819955964706c876bc2f7ecea10adf.tar.gz volse-hubzilla-9410b63bbc819955964706c876bc2f7ecea10adf.tar.bz2 volse-hubzilla-9410b63bbc819955964706c876bc2f7ecea10adf.zip |
Revised permissions checks across API and enabled collaborative editing using the write_pages per-channel permission.
Diffstat (limited to 'include/wiki.php')
-rw-r--r-- | include/wiki.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/include/wiki.php b/include/wiki.php index 23a22007f..f0785d549 100644 --- a/include/wiki.php +++ b/include/wiki.php @@ -196,10 +196,19 @@ function wiki_get_permissions($resource_id, $owner_id, $observer_hash) { dbesc(WIKI_ITEM_RESOURCE_TYPE), dbesc($resource_id) ); - if(!$r) { + + if (!$r) { return array('read' => false, 'write' => false, 'success' => true); } else { - return array('read' => true, 'write' => false, 'success' => true); + $perms = get_all_perms($owner_id, $observer_hash); + // TODO: Create a new permission setting for wiki analogous to webpages. Until + // then, use webpage permissions + if (!$perms['write_pages']) { + $write = false; + } else { + $write = true; + } + return array('read' => true, 'write' => $write, 'success' => true); } } |