the view_photos and post_photos permissions are redundant and are now mapped to view_storage and write_storage

This commit is contained in:
redmatrix
2015-07-19 17:53:52 -07:00
parent ed3d9d1f80
commit ec00c5b18a
10 changed files with 36 additions and 74 deletions

View File

@@ -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'),

View File

@@ -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'),

View File

@@ -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']);

View File

@@ -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);