diff options
author | zotlabs <mike@macgirvin.com> | 2017-02-01 18:05:02 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-02-01 18:05:02 -0800 |
commit | 94290102b6e1b29b29c58318670da797394550c1 (patch) | |
tree | 12bdfade060ccab26480913583ad544239c2e1f5 /Zotlabs/Module/Wiki.php | |
parent | f94c244b9f6d1d1ccda36adeda08f2d04684a4a2 (diff) | |
download | volse-hubzilla-94290102b6e1b29b29c58318670da797394550c1.tar.gz volse-hubzilla-94290102b6e1b29b29c58318670da797394550c1.tar.bz2 volse-hubzilla-94290102b6e1b29b29c58318670da797394550c1.zip |
tested extensible permissions by adding wiki permissions. Discovered a couple of issues that needed attention in the process.
Diffstat (limited to 'Zotlabs/Module/Wiki.php')
-rw-r--r-- | Zotlabs/Module/Wiki.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php index 5397deebe..d42c26681 100644 --- a/Zotlabs/Module/Wiki.php +++ b/Zotlabs/Module/Wiki.php @@ -45,6 +45,11 @@ class Wiki extends \Zotlabs\Web\Controller { } + if(! perm_is_allowed(\App::$profile_uid,get_observer_hash(),'view_wiki')) { + notice( t('Permission denied.') . EOL); + return; + } + // TODO: Combine the interface configuration into a unified object // Something like $interface = array('new_page_button' => false, 'new_wiki_button' => false, ...) @@ -309,7 +314,11 @@ class Wiki extends \Zotlabs\Web\Controller { return; } - + if(! perm_is_allowed(\App::$profile_uid,get_observer_hash(),'write_wiki')) { + notice( t('Permission denied.') . EOL); + return; + } + // /wiki/channel/preview // Render mardown-formatted text in HTML for preview if((argc() > 2) && (argv(2) === 'preview')) { |