42 if ($this->session_manager->getIgnoreAccess()) {
50 }
catch (UserFetchFailureException $e) {
74 }
catch (UserFetchFailureException $e) {
86 'owner_guid' =>
$entity->owner_guid,
87 'container_guid' =>
$entity->container_guid,
88 ],
$entity->getOriginalAttributes());
102 if (!isset(
$attrs[
'container_guid'])) {
133 }
catch (UserFetchFailureException $e) {
143 return $this->events->triggerResults(
'permissions_check:delete',
$entity->getType(),
$params, $return);
164 }
catch (UserFetchFailureException $e) {
172 return $this->events->triggerResults(
'permissions_check:delete',
'river',
$params,
false);
189 if ($this->canBypassPermissionsCheck(
$user_guid)) {
195 }
catch (UserFetchFailureException $e) {
220 return $this->events->triggerResults(
'permissions_check',
'annotation',
$params,
$result);
257 $logic_check = $this->events->triggerResults(
'container_logic_check',
$type,
$params);
259 if ($logic_check ===
false) {
263 if ($this->canBypassPermissionsCheck(
$user_guid)) {
273 return $this->events->triggerResults(
'container_permissions_check',
$type,
$params, $return);
294 $container_result = $this->canWriteToContainer(
$entity,
'object',
'comment',
$user_guid);
295 if ($this->canBypassPermissionsCheck(
$user_guid)) {
297 return $container_result;
306 return $this->events->triggerResults(
'permissions_check:comment',
$entity->getType(),
$params, $container_result);
331 }
catch (UserFetchFailureException $e) {
335 $return = (bool)
$user;
340 'annotation_name' => $annotation_name,
343 if (!empty($annotation_name)) {
344 $return = $this->events->triggerResults(
"permissions_check:annotate:$annotation_name",
$entity->getType(),
$params, $return);
347 return $this->events->triggerResults(
'permissions_check:annotate',
$entity->getType(),
$params, $return);
368 }
catch (UserFetchFailureException $e) {
377 return $this->events->triggerResults(
'permissions_check:download',
'file',
$params,
$default);
$params
Saves global plugin settings.
Entity table database service.
Exception indicating a user could not be looked up for a permissions check.
User capabilities service.
canDownload(\ElggFile $entity, int $user_guid=0, bool $default=true)
Can a user download a file?
canWriteToContainer(\ElggEntity $entity, string $type, string $subtype, int $user_guid=0)
Can a user add an entity to this container.
canComment(\ElggEntity $entity, int $user_guid=0)
Can a user comment on an entity?
canBypassPermissionsCheck(int $user_guid=0)
Decides if the access system should be ignored for a user.
__construct(protected EventsService $events, protected EntityTable $entities, protected SessionManagerService $session_manager)
Constructor.
canEdit(\ElggEntity $entity, int $user_guid=0)
Can a user edit this entity?
canAnnotate(\ElggEntity $entity, int $user_guid=0, string $annotation_name='')
Can a user annotate an entity?
canDeleteRiverItem(\ElggRiverItem $item, int $user_guid=0)
Can a user delete this river item?
canDelete(\ElggEntity $entity, int $user_guid=0)
Can a user delete this entity?
canEditAnnotation(\ElggEntity $entity, int $user_guid=0, ?\ElggAnnotation $annotation=null)
Determines whether the user can edit this annotation.
if(empty($title) &&empty($body)) if(!empty($link)) $attrs
if(parse_url(elgg_get_site_url(), PHP_URL_PATH) !=='/') if(file_exists(elgg_get_root_path() . 'robots.txt'))
Set robots.txt.