From ec00c5b18a1efea64517b18fa12bb9df6f0b95f7 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 19 Jul 2015 17:53:52 -0700 Subject: the view_photos and post_photos permissions are redundant and are now mapped to view_storage and write_storage --- mod/editblock.php | 2 +- mod/editwebpage.php | 5 +---- mod/photo.php | 2 +- mod/photos.php | 6 +++--- 4 files changed, 6 insertions(+), 9 deletions(-) (limited to 'mod') diff --git a/mod/editblock.php b/mod/editblock.php index 818dc5ec7..b4d954ef5 100644 --- a/mod/editblock.php +++ b/mod/editblock.php @@ -137,7 +137,7 @@ function editblock_content(&$a) { '$underline' => t('Underline'), '$quote' => t('Quote'), '$code' => t('Code'), - '$writefiles' => (perm_is_allowed($owner, get_observer_hash(), 'post_photos') || perm_is_allowed($owner, get_observer_hash(), 'write_storage')), + '$writefiles' => perm_is_allowed($owner, get_observer_hash(), 'write_storage'), '$upload' => t('Upload photo'), '$attach' => t('Attach file'), '$weblink' => t('Insert web link'), diff --git a/mod/editwebpage.php b/mod/editwebpage.php index 3b0b543a6..974e8cc38 100644 --- a/mod/editwebpage.php +++ b/mod/editwebpage.php @@ -165,15 +165,12 @@ function editwebpage_content(&$a) { $rp = 'webpages/' . $which; - logger('canwrite: ' . (perm_is_allowed($owner, get_observer_hash(), 'post_photos') || perm_is_allowed($owner, get_observer_hash(), 'write_storage'))); - $editor = replace_macros($tpl,array( '$return_path' => $rp, '$webpage' => ITEM_TYPE_WEBPAGE, '$placeholdpagetitle' => t('Page link title'), '$pagetitle' => $page_title, - '$writefiles' => (perm_is_allowed($owner, get_observer_hash(), 'post_photos') || perm_is_allowed($owner, get_observer_hash(), 'write_storage')), - + '$writefiles' => perm_is_allowed($owner, get_observer_hash(), 'write_storage'), '$action' => 'item', '$share' => t('Edit'), '$bold' => t('Bold'), diff --git a/mod/photo.php b/mod/photo.php index 2e16fc1d9..e8cd95f1c 100644 --- a/mod/photo.php +++ b/mod/photo.php @@ -123,7 +123,7 @@ function photo_init(&$a) { ); if($r) { - $allowed = (($r[0]['uid']) ? perm_is_allowed($r[0]['uid'],$observer_xchan,'view_photos') : true); + $allowed = (($r[0]['uid']) ? perm_is_allowed($r[0]['uid'],$observer_xchan,'view_storage') : true); $sql_extra = permissions_sql($r[0]['uid']); diff --git a/mod/photos.php b/mod/photos.php index c65c87c27..b65218e94 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -63,7 +63,7 @@ function photos_post(&$a) { $page_owner_uid = $a->data['channel']['channel_id']; - if(perm_is_allowed($page_owner_uid,get_observer_hash(),'post_photos')) + if(perm_is_allowed($page_owner_uid,get_observer_hash(),'write_storage')) $can_post = true; if(! $can_post) { @@ -495,8 +495,8 @@ function photos_content(&$a) { $observer = $a->get_observer(); - $can_post = perm_is_allowed($owner_uid,$observer['xchan_hash'],'post_photos'); - $can_view = perm_is_allowed($owner_uid,$observer['xchan_hash'],'view_photos'); + $can_post = perm_is_allowed($owner_uid,$observer['xchan_hash'],'write_storage'); + $can_view = perm_is_allowed($owner_uid,$observer['xchan_hash'],'view_storage'); if(! $can_view) { notice( t('Access to this item is restricted.') . EOL); -- cgit v1.2.3