42 if ($this->session_manager->getIgnoreAccess()) {
68 if ($this->canBypassPermissionsCheck(
$user_guid)) {
86 'owner_guid' => $entity->owner_guid,
87 'container_guid' => $entity->container_guid,
98 if ($entity->guid ==
$user->guid) {
102 if (!isset(
$attrs[
'container_guid'])) {
127 if ($this->canBypassPermissionsCheck(
$user_guid)) {
143 return $this->events->triggerResults(
'permissions_check:delete', $entity->
getType(),
$params, $return);
158 if ($this->canBypassPermissionsCheck(
$user_guid)) {
172 return $this->events->triggerResults(
'permissions_check:delete',
'river',
$params,
false);
189 if ($this->canBypassPermissionsCheck(
$user_guid)) {
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);
325 if ($this->canBypassPermissionsCheck(
$user_guid)) {
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);
362 if ($this->canBypassPermissionsCheck(
$user_guid)) {
377 return $this->events->triggerResults(
'permissions_check:download',
'file',
$params,
$default);
canBypassPermissionsCheck(int $user_guid=0)
Decides if the access system should be ignored for a user.
$params
Saves global plugin settings.
__construct(protected EventsService $events, protected EntityTable $entities, protected SessionManagerService $session_manager)
Constructor.
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.
canEdit(int $user_guid=0)
Can a user edit this entity?
canEditAnnotation(\ElggEntity $entity, int $user_guid=0,\ElggAnnotation $annotation=null)
Determines whether or not the user can edit this annotation.
Exception indicating a user could not be looked up for a permissions check.
canEdit(\ElggEntity $entity, int $user_guid=0)
Can a user edit this entity?
canComment(\ElggEntity $entity, int $user_guid=0)
Can a user comment on an entity?
canAnnotate(\ElggEntity $entity, int $user_guid=0, string $annotation_name= '')
Can a user annotate an entity?
getType()
Returns the entity type.
getOriginalAttributes()
Get the original values of attribute(s) that have been modified since the entity was persisted...
canDelete(\ElggEntity $entity, int $user_guid=0)
Can a user delete this entity?
canDeleteRiverItem(\ElggRiverItem $item, int $user_guid=0)
Can a user delete this river item?
User capabilities service.
if(empty($title)&&empty($body)) if(!empty($link)) $attrs
Entity table database service.