39 $this->events = $events;
40 $this->entities = $entities;
41 $this->session_manager = $session_manager;
56 if ($this->session_manager->getIgnoreAccess()) {
82 if ($this->canBypassPermissionsCheck(
$user_guid)) {
100 'owner_guid' => $entity->owner_guid,
101 'container_guid' => $entity->container_guid,
112 if ($entity->guid ==
$user->guid) {
116 if (!isset(
$attrs[
'container_guid'])) {
141 if ($this->canBypassPermissionsCheck(
$user_guid)) {
157 return $this->events->triggerResults(
'permissions_check:delete', $entity->
getType(),
$params, $return);
172 if ($this->canBypassPermissionsCheck(
$user_guid)) {
186 return $this->events->triggerResults(
'permissions_check:delete',
'river',
$params,
false);
203 if ($this->canBypassPermissionsCheck(
$user_guid)) {
234 return $this->events->triggerResults(
'permissions_check',
'annotation',
$params,
$result);
271 $logic_check = $this->events->triggerResults(
'container_logic_check', $type,
$params);
273 if ($logic_check ===
false) {
277 if ($this->canBypassPermissionsCheck(
$user_guid)) {
287 return $this->events->triggerResults(
'container_permissions_check', $type,
$params, $return);
308 $container_result = $this->canWriteToContainer($entity,
'object',
'comment',
$user_guid);
309 if ($this->canBypassPermissionsCheck(
$user_guid)) {
311 return $container_result;
320 return $this->events->triggerResults(
'permissions_check:comment', $entity->
getType(),
$params, $container_result);
339 if ($this->canBypassPermissionsCheck(
$user_guid)) {
349 $return = (bool)
$user;
354 'annotation_name' => $annotation_name,
357 if (!empty($annotation_name)) {
358 $return = $this->events->triggerResults(
"permissions_check:annotate:$annotation_name", $entity->
getType(),
$params, $return);
361 return $this->events->triggerResults(
'permissions_check:annotate', $entity->
getType(),
$params, $return);
376 if ($this->canBypassPermissionsCheck(
$user_guid)) {
391 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(EventsService $events, EntityTable $entities, 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.