* [bug#49351,done,1h] The articles in the document template do not check permissions.

This commit is contained in:
hufangzhou
2024-06-11 14:09:04 +08:00
parent cfb1977340
commit 06f2ec6e57
3 changed files with 7 additions and 5 deletions
+2 -2
View File
@@ -1217,7 +1217,7 @@ class docModel extends model
if(!isset($doc->lib)) return false;
/* Asset document don't check privilege. */
if(isset($doc->assetLibType) && $doc->assetLibType) return true;
if((isset($doc->assetLibType) && $doc->assetLibType) || $doc->type == 'article') return true;
/* My document are accessible only to the creator. */
if($doc->status == 'draft' && $doc->addedBy != $this->app->user->account) return false;
@@ -1443,7 +1443,7 @@ class docModel extends model
->groupBy('root')
->fetchPairs();
$docs = $this->dao->select("`id`,`addedBy`,`lib`,`acl`,`users`,`groups`,`status`")->from(TABLE_DOC)
$docs = $this->dao->select("`id`,`addedBy`,`type`,`lib`,`acl`,`users`,`groups`,`status`")->from(TABLE_DOC)
->where('lib')->in($idList)
->andWhere('deleted')->eq(0)
->andWhere('module')->eq(0)