This commit is contained in:
conory 2022-08-05 23:31:02 +09:00
parent 99d16d84c3
commit 582024daf4
4 changed files with 27 additions and 37 deletions

View file

@ -42,18 +42,13 @@ class commentController extends comment
$oComment = CommentModel::getComment($comment_srl, false, false);
if(!$oComment->isExists())
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
throw new Rhymix\Framework\Exceptions\TargetNotFound;
}
if(!$oComment->isAccessible(true))
{
throw new Rhymix\Framework\Exceptions\NotPermitted;
}
$module_srl = $oComment->get('module_srl');
if(!$module_srl)
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
}
$comment_config = ModuleModel::getModulePartConfig('comment', $module_srl);
$comment_config = ModuleModel::getModulePartConfig('comment', $oComment->get('module_srl'));
if($comment_config->use_vote_up === 'N')
{
throw new Rhymix\Framework\Exceptions\FeatureDisabled;
@ -83,7 +78,7 @@ class commentController extends comment
$oComment = CommentModel::getComment($comment_srl, false, false);
if(!$oComment->isExists())
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
throw new Rhymix\Framework\Exceptions\TargetNotFound;
}
if(!$oComment->isAccessible(true))
{
@ -126,18 +121,13 @@ class commentController extends comment
$oComment = CommentModel::getComment($comment_srl, false, false);
if(!$oComment->isExists())
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
throw new Rhymix\Framework\Exceptions\TargetNotFound;
}
if(!$oComment->isAccessible(true))
{
throw new Rhymix\Framework\Exceptions\NotPermitted;
}
$module_srl = $oComment->get('module_srl');
if(!$module_srl)
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
}
$comment_config = ModuleModel::getModulePartConfig('comment', $module_srl);
$comment_config = ModuleModel::getModulePartConfig('comment', $oComment->get('module_srl'));
if($comment_config->use_vote_down === 'N')
{
throw new Rhymix\Framework\Exceptions\FeatureDisabled;
@ -167,7 +157,7 @@ class commentController extends comment
$oComment = CommentModel::getComment($comment_srl, false, false);
if(!$oComment->isExists())
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
throw new Rhymix\Framework\Exceptions\TargetNotFound;
}
if(!$oComment->isAccessible(true))
{
@ -280,7 +270,7 @@ class commentController extends comment
$oComment = CommentModel::getComment($comment_srl, false, false);
if(!$oComment->isExists())
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
throw new Rhymix\Framework\Exceptions\TargetNotFound;
}
if(!$oComment->isAccessible(true))
{

View file

@ -197,7 +197,12 @@ class commentItem extends BaseObject
if ($strict)
{
$grant = ModuleModel::getGrant(ModuleModel::getModuleInfoByModuleSrl($this->get('module_srl')), Context::get('logged_info'));
$module_info = ModuleModel::getModuleInfoByModuleSrl($this->get('module_srl'));
if (!$module_info)
{
return false;
}
$grant = ModuleModel::getGrant($module_info, Context::get('logged_info'));
if (isset($grant->list) && isset($grant->view) && ($grant->list !== true || $grant->view !== true))
{
return false;

View file

@ -46,18 +46,13 @@ class documentController extends document
$oDocument = DocumentModel::getDocument($document_srl, false, false);
if(!$oDocument->isExists())
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
throw new Rhymix\Framework\Exceptions\TargetNotFound;
}
if(!$oDocument->isAccessible(true))
{
throw new Rhymix\Framework\Exceptions\NotPermitted;
}
$module_srl = $oDocument->get('module_srl');
if(!$module_srl)
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
}
$document_config = ModuleModel::getModulePartConfig('document', $module_srl);
$document_config = ModuleModel::getModulePartConfig('document', $oDocument->get('module_srl'));
if($document_config->use_vote_up === 'N')
{
throw new Rhymix\Framework\Exceptions\FeatureDisabled;
@ -101,7 +96,7 @@ class documentController extends document
$oDocument = DocumentModel::getDocument($document_srl, false, false);
if(!$oDocument->isExists())
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
throw new Rhymix\Framework\Exceptions\TargetNotFound;
}
if(!$oDocument->isAccessible(true))
{
@ -165,18 +160,13 @@ class documentController extends document
$oDocument = DocumentModel::getDocument($document_srl, false, false);
if(!$oDocument->isExists())
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
throw new Rhymix\Framework\Exceptions\TargetNotFound;
}
if(!$oDocument->isAccessible(true))
{
throw new Rhymix\Framework\Exceptions\NotPermitted;
}
$module_srl = $oDocument->get('module_srl');
if(!$module_srl)
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
}
$document_config = ModuleModel::getModulePartConfig('document', $module_srl);
$document_config = ModuleModel::getModulePartConfig('document', $oDocument->get('module_srl'));
if($document_config->use_vote_down === 'N')
{
throw new Rhymix\Framework\Exceptions\FeatureDisabled;
@ -214,7 +204,7 @@ class documentController extends document
$oDocument = DocumentModel::getDocument($document_srl, false, false);
if(!$oDocument->isExists())
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
throw new Rhymix\Framework\Exceptions\TargetNotFound;
}
if(!$oDocument->isAccessible(true))
{
@ -341,7 +331,7 @@ class documentController extends document
$oDocument = DocumentModel::getDocument($document_srl, false, false);
if(!$oDocument->isExists())
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
throw new Rhymix\Framework\Exceptions\TargetNotFound;
}
if(!$oDocument->isAccessible(true))
{
@ -383,7 +373,7 @@ class documentController extends document
$oDocument = DocumentModel::getDocument($document_srl, false, false);
if(!$oDocument->isExists())
{
throw new Rhymix\Framework\Exceptions\InvalidRequest;
throw new Rhymix\Framework\Exceptions\TargetNotFound;
}
if(!$oDocument->isAccessible(true))
{

View file

@ -246,7 +246,12 @@ class documentItem extends BaseObject
if ($strict)
{
$grant = ModuleModel::getGrant(ModuleModel::getModuleInfoByModuleSrl($this->get('module_srl')), Context::get('logged_info'));
$module_info = ModuleModel::getModuleInfoByModuleSrl($this->get('module_srl'));
if (!$module_info)
{
return false;
}
$grant = ModuleModel::getGrant($module_info, Context::get('logged_info'));
if (isset($grant->list) && isset($grant->view) && ($grant->list !== true || $grant->view !== true))
{
return false;