mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
PHRAS-3724 restrict download option when print (#4112)
This commit is contained in:
@@ -286,7 +286,12 @@ class PDFRecords extends PDF
|
||||
|
||||
$downloadLink = $rec->get_title();
|
||||
|
||||
if ($this->canDownload && !empty($this->downloadSubdef) && $rec->has_subdef($this->downloadSubdef)) {
|
||||
|
||||
if ($this->canDownload && !empty($this->downloadSubdef) && $rec->has_subdef($this->downloadSubdef)
|
||||
&& (($rec->get_subdef($this->downloadSubdef)->get_name() != 'document' && $this->app->getAclForUser($this->app->getAuthenticatedUser())->has_right_on_base($rec->getBaseId(), \ACL::CANDWNLDPREVIEW))
|
||||
||
|
||||
($rec->get_subdef($this->downloadSubdef)->get_name() == 'document' && $this->app->getAclForUser($this->app->getAuthenticatedUser())->has_right_on_base($rec->getBaseId(), \ACL::CANDWNLDHD)))
|
||||
) {
|
||||
$sd = $rec->get_subdef($this->downloadSubdef);
|
||||
if ($sd->is_physically_present()) {
|
||||
$url = $this->getDownloadUrl($sd);
|
||||
@@ -431,7 +436,11 @@ class PDFRecords extends PDF
|
||||
$p0 = $this->pdf->PageNo();
|
||||
$y0 = $this->pdf->GetY();
|
||||
|
||||
if ($this->canDownload && !empty($this->downloadSubdef) && $rec->has_subdef($this->downloadSubdef)) {
|
||||
if ($this->canDownload && !empty($this->downloadSubdef) && $rec->has_subdef($this->downloadSubdef)
|
||||
&& (($rec->get_subdef($this->downloadSubdef)->get_name() != 'document' && $this->app->getAclForUser($this->app->getAuthenticatedUser())->has_right_on_base($rec->getBaseId(), \ACL::CANDWNLDPREVIEW))
|
||||
||
|
||||
($rec->get_subdef($this->downloadSubdef)->get_name() == 'document' && $this->app->getAclForUser($this->app->getAuthenticatedUser())->has_right_on_base($rec->getBaseId(), \ACL::CANDWNLDHD)))
|
||||
) {
|
||||
$sd = $rec->get_subdef($this->downloadSubdef);
|
||||
if ($sd->is_physically_present()) {
|
||||
$url = $this->getDownloadUrl($sd);
|
||||
@@ -522,7 +531,11 @@ class PDFRecords extends PDF
|
||||
$this->pdf->SetY($y = $y2);
|
||||
$this->pdf->SetY($y + 2);
|
||||
|
||||
if ($this->canDownload && !empty($this->downloadSubdef) && $rec->has_subdef($this->downloadSubdef)) {
|
||||
if ($this->canDownload && !empty($this->downloadSubdef) && $rec->has_subdef($this->downloadSubdef)
|
||||
&& ((($rec->get_subdef($this->downloadSubdef)->get_name() != 'document' && $this->app->getAclForUser($this->app->getAuthenticatedUser())->has_right_on_base($rec->getBaseId(), \ACL::CANDWNLDPREVIEW))
|
||||
||
|
||||
($rec->get_subdef($this->downloadSubdef)->get_name() == 'document' && $this->app->getAclForUser($this->app->getAuthenticatedUser())->has_right_on_base($rec->getBaseId(), \ACL::CANDWNLDHD))) )
|
||||
) {
|
||||
$sd = $rec->get_subdef($this->downloadSubdef);
|
||||
if ($sd->is_physically_present()) {
|
||||
$url = $this->getDownloadUrl($sd);
|
||||
@@ -810,7 +823,11 @@ class PDFRecords extends PDF
|
||||
}
|
||||
$this->pdf->SetXY($lmargin, $y += ( $finalHeight + 5));
|
||||
|
||||
if ($this->canDownload && !empty($this->downloadSubdef) && $rec->has_subdef($this->downloadSubdef)) {
|
||||
if ($this->canDownload && !empty($this->downloadSubdef) && $rec->has_subdef($this->downloadSubdef)
|
||||
&& ((($rec->get_subdef($this->downloadSubdef)->get_name() != 'document' && $this->app->getAclForUser($this->app->getAuthenticatedUser())->has_right_on_base($rec->getBaseId(), \ACL::CANDWNLDPREVIEW))
|
||||
||
|
||||
($rec->get_subdef($this->downloadSubdef)->get_name() == 'document' && $this->app->getAclForUser($this->app->getAuthenticatedUser())->has_right_on_base($rec->getBaseId(), \ACL::CANDWNLDHD))))
|
||||
) {
|
||||
$sd = $rec->get_subdef($this->downloadSubdef);
|
||||
if ($sd->is_physically_present()) {
|
||||
$url = $this->getDownloadUrl($sd);
|
||||
|
Reference in New Issue
Block a user