19declare(strict_types=1);
26use ILIAS\Blog\Access\BlogAccess;
36 protected const BLOG =
"blog";
55 foreach ($posting_ids as $posting_id) {
56 if (!$this->perm_manager->postingIdMatches($posting_id)) {
65 if ($this->blog_exercise ===
null) {
69 foreach ($this->blog_exercise->getAssignmentsOfBlog() as $assignment) {
70 if ($assignment[
"ass_id"] === $assignment_id) {
81 string $entity_id =
""
99 "createExportFileWithComments",
103 "addUserFromAutoComplete",
105 "confirmRemoveContributor",
107 "setContentStyleSheet",
110 return $this->
access->checkAccess(
"write",
"", $node_id);
116 return $this->perm_manager->mayContribute();
121 "render",
"preview",
"addToDesk",
"removeFromDesk",
"renderFullscreen",
122 "setNotification",
"printViewSelection",
"printPostings"
124 return $this->
access->checkAccess(
"read",
"", $node_id);
131 return $this->
access->checkAccess(
"visible",
"", $node_id);
140 if (in_array($cmd, [
"printViewSelection",
"printPostings"])) {
141 return $this->
access->checkAccess(
"read",
"", $node_id) &&
142 $this->perm_manager->postingIdMatches($posting_id);
150 return $this->perm_manager->canApprove($posting_id);
158 if (in_array($cmd, [
"downloadExcAssFile",
"downloadExcSubFile",
"finalize"])) {
159 return $this->
access->checkAccess(
"read",
"", $node_id) &&
160 $this->assignmentBelongsToBlog($assignment_id);
168 if ($this->isClass(\ilObjBlogGUI::class)) {
176 if ($this->isClass(\ilObjBlogGUI::class) || $this->isClass(EditingGUI::class)) {
178 if (in_array($this->
ctrl->getCmd(), [
"approve",
"deactivateAdmin"])) {
179 $posting_id = $this->request->getApId();
180 return $this->cmdEntity(
185 if (in_array($this->
ctrl->getCmd(), [
"printViewSelection",
"printPostings"])) {
186 $posting_ids = $this->request->getObjIds();
187 if ($posting_ids !== []) {
188 return $this->cmdEntity(self::POSTING, $posting_ids);
191 return $this->cmdEntity(
195 if ($this->isClass(\ilBlogExerciseGUI::class)) {
196 return $this->cmdEntity(
197 self::BLOG_ASSIGNMENT,
198 (
string) $this->request->getAssId()
207 return $this->request->getWspId();
209 return $this->request->getRefId();
216 $node_id = $this->getRequestNodeId();
217 $posting_id = $this->request->getBlogPage();
218 if ($from_class === \ilObjBlogGUI::class) {
221 if ($to_class === \ilCommonActionDispatcherGUI::class) {
222 return $this->
access->checkAccess(
"visible",
"", $node_id) ||
223 $this->
access->checkAccess(
"read",
"", $node_id);
227 if ($to_class === \ilPermissionGUI::class) {
228 return $this->
access->checkAccess(
"edit_permission",
"", $node_id);
231 if ($to_class === EditingGUI::class && in_array($this->
ctrl->getCmd(), [
234 "printViewSelection",
237 return $this->isRequestCommandPermitted();
241 if ($to_class === \ilBlogPostingGUI::class) {
242 return $this->perm_manager->canReadPosting($posting_id);
246 if (in_array($to_class, [
248 \ilRepositorySearchGUI::class,
249 \ilObjectContentStyleSettingsGUI::class,
250 \ilObjNotificationSettingsGUI::class,
251 \ilObjectMetaDataGUI::class,
253 \
ILIAS\
Blog\Settings\BlockSettingsGUI::class,
256 ContributorGUI::class,
258 return $this->
access->checkAccess(
"write",
"", $node_id);
264 if (in_array($to_class, [
265 \ilObjectCopyGUI::class,
266 \
ILIAS\
Blog\Presentation\PresentationGUI::class
268 return $this->
access->checkAccess(
"read",
"", $node_id);
271 if ($to_class === \ilBlogExerciseGUI::class) {
272 $assignment_id = $this->request?->getAssId() ?? 0;
273 return $assignment_id === 0
274 ? $this->
access->checkAccess(
"read",
"", $node_id)
275 : $this->isRequestCommandPermitted();
279 if ($to_class === \ilInfoScreenGUI::class) {
280 return $this->
access->checkAccess(
"visible",
"", $node_id);
@ilCtrl_Calls ILIAS\Blog\Contributor\ContributorGUI: ilRepositorySearchGUI
@ilCtrl_Calls ILIAS\Blog\Editing\EditingGUI: ilRepositorySearchGUI, ilBlogPostingGUI
__construct(protected \ilLanguage $lng, protected PermissionManager $perm_manager, ?\ilGlobalTemplateInterface $tpl=null, protected ?\ilCtrlInterface $ctrl=null, protected ?StandardGUIRequest $request=null, protected ?BlogExercise $blog_exercise=null)
isCommandPermitted(string $cmd, int $node_id, string $entity, string $entity_id="")
hasPostingCmdPerm(string $cmd, int $node_id, int $posting_id)
postingsBelongToBlog(array $posting_ids)
hasBlogAssignmentCmdPerm(string $cmd, int $node_id, int $assignment_id)
assignmentBelongsToBlog(int $assignment_id)
isForwardPermitted(string $from_class, string $to_class)
ilAccessHandler ilWorkspaceAccessHandler $access
hasBlogCmdPerm(string $cmd, int $node_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$request
@ilCtrl_Calls ilObjLearningSequenceContentGUI: ilObjLearningSequenceConditionsGUI
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
readonly ilGlobalTemplateInterface $tpl
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.