aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-11-01 15:38:53 +0000
committerMario <mario@mariovavti.com>2023-11-01 15:38:53 +0000
commit4f334525c2fcb17bee095a02495a025c7bf1a501 (patch)
treebc87331b578da64b590cf4cd390c1091a9b629a7
parent67aaa979049ea2666da1fb313b2b095e27422128 (diff)
downloadvolse-hubzilla-4f334525c2fcb17bee095a02495a025c7bf1a501.tar.gz
volse-hubzilla-4f334525c2fcb17bee095a02495a025c7bf1a501.tar.bz2
volse-hubzilla-4f334525c2fcb17bee095a02495a025c7bf1a501.zip
only show tools to creators if they still have perms
-rw-r--r--Zotlabs/Storage/Browser.php2
-rw-r--r--view/tpl/cloud_directory.tpl4
2 files changed, 4 insertions, 2 deletions
diff --git a/Zotlabs/Storage/Browser.php b/Zotlabs/Storage/Browser.php
index 590c1cd9c..912b4442d 100644
--- a/Zotlabs/Storage/Browser.php
+++ b/Zotlabs/Storage/Browser.php
@@ -209,7 +209,6 @@ class Browser extends DAV\Browser\Plugin {
// upload access. system.thumbnail_security should be set to 1 if you want to include these
// types
- $is_creator = false;
$photo_icon = '';
$preview_style = intval(get_config('system','thumbnail_security',0));
@@ -369,6 +368,7 @@ class Browser extends DAV\Browser\Plugin {
'$upload' => t('Add Files'),
'$is_owner' => $is_owner,
'$is_admin' => is_site_admin(),
+ '$has_perms' => perm_is_allowed($channel_id, get_observer_hash(), 'write_storage'),
'$admin_delete_label' => t('Admin Delete'),
'$parentpath' => $parent_path,
'$folder_parent' => $folder_parent,
diff --git a/view/tpl/cloud_directory.tpl b/view/tpl/cloud_directory.tpl
index 7bc298203..9b8d85ab4 100644
--- a/view/tpl/cloud_directory.tpl
+++ b/view/tpl/cloud_directory.tpl
@@ -156,7 +156,7 @@
{{/if}}
</td>
<td class="cloud-index-tool">
- {{if ($is_owner || $item.is_creator) && $item.attach_id}}
+ {{if ($is_owner || ($item.is_creator && $has_perms)) && $item.attach_id}}
<div class="dropdown">
<button class="btn btn-link btn-sm" id="dropdown-button-{{$item.attach_id}}" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-fw fa-ellipsis-v"></i>
@@ -203,6 +203,7 @@
<td class="d-none d-md-table-cell p-2">{{$item.size_formatted}}</td>
<td class="d-none d-md-table-cell p-2">{{$item.last_modified}}</td>
</tr>
+ {{if ($is_owner || ($item.is_creator && $has_perms)) && $item.attach_id}}
<tr id="cloud-tools-{{$item.attach_id}}" class="cloud-tools">
<td id="attach-edit-panel-{{$item.attach_id}}" class="attach-edit-panel" colspan="8">
<form id="attach_edit_form_{{$item.attach_id}}" action="attach_edit" method="post" class="acl-form" data-form_id="attach_edit_form_{{$item.attach_id}}" data-allow_cid='{{$item.allow_cid}}' data-allow_gid='{{$item.allow_gid}}' data-deny_cid='{{$item.deny_cid}}' data-deny_gid='{{$item.deny_gid}}'>
@@ -266,6 +267,7 @@
</form>
</td>
</tr>
+ {{/if}}
{{/foreach}}
</table>
{{/if}}