Fixed bug in access control. Hide new wiki/page buttons if not channel owner.

This commit is contained in:
Andrew Manning
2016-05-29 21:23:56 -04:00
parent a3dfdd9d38
commit 4b350b9090
3 changed files with 3 additions and 7 deletions

View File

@@ -8,11 +8,7 @@ use \Zotlabs\Storage\GitRepo as GitRepo;
define ( 'WIKI_ITEM_RESOURCE_TYPE', 'wiki' );
function wiki_list($channel, $observer_hash) {
if (local_channel() || remote_channel()) {
$sql_extra = item_permissions_sql($channel['channel_id'], $observer_hash);
} else {
$sql_extra = " AND item_private = 0 ";
}
$sql_extra = item_permissions_sql($channel['channel_id'], $observer_hash);
$wikis = q("SELECT * FROM item WHERE resource_type = '%s' AND mid = parent_mid AND item_deleted = 0 $sql_extra",
dbesc(WIKI_ITEM_RESOURCE_TYPE)
);