19declare(strict_types=1);
43 $this->user_id =
$domain->user()->getId();
44 $this->
settings = $domain->settings();
45 $this->
access = $domain->access();
61 $public_deletion_enabled =
false
66 $settings = $this->settings;
67 $access = $this->access;
68 $user_can_delete_their_comments = (bool) $settings->get(
"comments_del_user",
'0');
69 $tutor_can_delete_comments = (bool) $settings->get(
"comments_del_tutor",
'1');
75 $is_author = ($note->getAuthor() ===
$user_id);
81 if ($public_deletion_enabled && $note->getType() ===
Note::PUBLIC) {
85 if ($is_author && $user_can_delete_their_comments && $note->getType() ===
Note::PUBLIC) {
90 if ($tutor_can_delete_comments) {
92 if ($access->checkAccess(
"write",
"",
$ref_id)) {
__construct(InternalDataService $data, InternalRepoService $repo, InternalDomainService $domain)
InternalDomainService $domain
canDelete(Note $note, int $user_id=0, $public_deletion_enabled=false)
InternalDataService $data
InternalRepoService $repo
canEdit(Note $note, int $user_id=0)
static _getAllReferences(int $id)
get all reference ids for object ID
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(!file_exists('../ilias.ini.php'))