* [story#76075] Remove the depend of file download.

This commit is contained in:
xieqiyu
2026-01-04 06:09:55 +00:00
parent 313111f809
commit d44434e1d5
2 changed files with 3 additions and 5 deletions
+2 -4
View File
@@ -1246,8 +1246,6 @@ class fileModel extends model
*/
public function printFile(object $file, string $method, bool $showDelete, bool $showEdit, object|null $object): string
{
if(!common::hasPriv('file', 'download') && !common::hasPriv('file', 'preview')) return '';
$html = '';
$sessionString = session_name() . '=' . session_id();
@@ -1324,10 +1322,10 @@ class fileModel extends model
if(stripos('txt|jpg|jpeg|gif|png|bmp|mp4', $file->extension) !== false) $canPreview = true;
if(isset($this->config->file->libreOfficeTurnon) and $this->config->file->libreOfficeTurnon == 1 && $isOfficeFile) $canPreview = true;
if($canPreview)
if($canPreview && common::hasPriv('file', 'preview'))
{
$dataToggle = $isOfficeFile ? '' : " data-toggle='modal' data-size='lg'";
$html .= html::a(helper::createLink('file', 'download', "fileID=$file->id&mouse=left"), "<i class='icon icon-eye'></i>", $isOfficeFile ? '_blank' : '', "class='fileAction btn btn-link text-primary' title='{$this->lang->file->preview}' {$dataToggle}");
$html .= html::a(helper::createLink('file', 'preview', "fileID=$file->id&mouse=left"), "<i class='icon icon-eye'></i>", $isOfficeFile ? '_blank' : '', "class='fileAction btn btn-link text-primary' title='{$this->lang->file->preview}' {$dataToggle}");
}
if(common::hasPriv('file', 'download')) $html .= html::a($downloadLink, "<i class='icon icon-download'></i>", '_blank', "class='fileAction btn btn-link text-primary' title='{$this->lang->file->downloadFile}'");
if(common::hasPriv($objectType, 'edit', $object))
+1 -1
View File
@@ -2976,7 +2976,7 @@ $config->group->package->file->privs['file-edit'] = array('edition' => '
$config->group->package->file->privs['file-delete'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd,lite,or', 'order' => 2, 'depend' => array(), 'recommend' => array('file-edit'));
$config->group->package->file->privs['file-uploadImages'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd,lite,or', 'order' => 3, 'depend' => array(), 'recommend' => array());
$config->group->package->file->privs['file-setPublic'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd,lite,or', 'order' => 25, 'depend' => array(), 'recommend' => array());
$config->group->package->file->privs['file-preview'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd,lite,or', 'order' => 26, 'depend' => array('file-download'), 'recommend' => array());
$config->group->package->file->privs['file-preview'] = array('edition' => 'open,biz,max,ipd', 'vision' => 'rnd,lite,or', 'order' => 26, 'depend' => array(), 'recommend' => array());
$config->group->package->commonEffort = new stdclass();
$config->group->package->commonEffort->order = 5;