only show upload button to those with write_storage permission

This commit is contained in:
zotlabs 2017-08-08 23:12:08 -07:00
parent ca11d7b9a7
commit 8eb6dafe31
2 changed files with 3 additions and 0 deletions

View File

@ -740,6 +740,7 @@ class ThreadItem {
'$edvideo' => t('Video'),
'$preview' => t('Preview'), // ((feature_enabled($conv->get_profile_owner(),'preview')) ? t('Preview') : ''),
'$indent' => $indent,
'$can_upload' => perm_is_allowed($conv->get_profile_owner(),get_observer_hash(),'write_storage'),
'$feature_encrypt' => ((feature_enabled($conv->get_profile_owner(),'content_encrypt')) ? true : false),
'$encrypt' => t('Encrypt text'),
'$cipher' => $conv->get_cipher(),

View File

@ -47,9 +47,11 @@
</button>
</div>
<div class="btn-group mr-2">
{{if $can_upload}}
<button class="btn btn-outline-secondary btn-sm" title="{{$edatt}}" onclick="insertCommentAttach('{{$comment}}',{{$id}}); return false;">
<i class="fa fa-paperclip comment-icon"></i>
</button>
{{/if}}
<button class="btn btn-outline-secondary btn-sm" title="{{$edurl}}" onclick="insertCommentURL('{{$comment}}',{{$id}}); return false;">
<i class="fa fa-link comment-icon"></i>
</button>