本文整理汇总了PHP中ArtefactTypeComment::viewable_in方法的典型用法代码示例。如果您正苦于以下问题:PHP ArtefactTypeComment::viewable_in方法的具体用法?PHP ArtefactTypeComment::viewable_in怎么用?PHP ArtefactTypeComment::viewable_in使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArtefactTypeComment
的用法示例。
在下文中一共展示了ArtefactTypeComment::viewable_in方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: AccessDeniedException
$author = $file->get('author');
$group = $file->get('group');
if (!empty($author) && !empty($group)) {
if ($USER->can_view_artefact($file)) {
$artefactok = true;
}
}
// The user may be trying to download a file that's not in the view, but which has
// been attached to public feedback on the view
if ($commentid = param_integer('comment', null)) {
if (!record_exists('artefact_attachment', 'artefact', $commentid, 'attachment', $fileid)) {
throw new AccessDeniedException('');
}
safe_require('artefact', 'comment');
$comment = new ArtefactTypeComment($commentid);
if (!$comment->viewable_in($viewid)) {
throw new AccessDeniedException('');
}
} else {
if ($artefactok == false) {
throw new AccessDeniedException('');
}
}
if (!can_view_view($viewid)) {
throw new AccessDeniedException('');
}
if (!$file instanceof ArtefactTypeFile) {
throw new NotFoundException();
}
} else {
// We just have a file ID