Add an option to check the permissions of modules linked to documents or comments

This commit is contained in:
conory 2022-08-04 11:06:23 +09:00
parent 7c963d0ac3
commit 0dd567bc00
3 changed files with 21 additions and 3 deletions

View file

@ -188,13 +188,22 @@ class commentItem extends BaseObject
}
}
function isAccessible()
function isAccessible($strict = false)
{
if(!$this->isExists())
{
return false;
}
if ($strict)
{
$grant = ModuleModel::getGrant(ModuleModel::getModuleInfoByModuleSrl($this->get('module_srl')), Context::get('logged_info'));
if (isset($grant->list) && isset($grant->view) && ($grant->list !== true || $grant->view !== true))
{
return false;
}
}
if (isset($_SESSION['accessible'][$this->comment_srl]) && $_SESSION['accessible'][$this->comment_srl] === $this->get('last_update'))
{
return true;