48 $this->hooks = $hooks;
49 $this->entities = $entities;
50 $this->session = $session;
67 if ($this->session->getIgnoreAccess()) {
94 if ($this->canBypassPermissionsCheck(
$user_guid)) {
113 'owner_guid' => $entity->owner_guid,
114 'container_guid' => $entity->container_guid,
126 if ($entity->guid ==
$user->guid) {
152 if ($this->canBypassPermissionsCheck(
$user_guid)) {
168 return $this->hooks->trigger(
'permissions_check:delete', $entity->
getType(),
$params, $return);
184 if ($this->canBypassPermissionsCheck(
$user_guid)) {
198 return $this->hooks->trigger(
'permissions_check:delete',
'river',
$params,
false);
222 elgg_deprecated_notice(__METHOD__ .
' is deprecated. Metadata no longer has it\'s own access system',
'3.0', 3);
224 if (!$entity->guid) {
229 if ($this->canBypassPermissionsCheck(
$user_guid)) {
248 return $this->hooks->triggerDeprecated(
'permissions_check:metadata', $entity->
getType(),
$params,
$default,
249 'Metadata no longer has it\'s own access system. You should not rely on this hook preventing metadata permissions.',
269 if ($this->canBypassPermissionsCheck(
$user_guid)) {
300 return $this->hooks->trigger(
'permissions_check',
'annotation',
$params,
$result);
338 $logic_check = $this->hooks->trigger(
'container_logic_check',
$type,
$params);
340 if ($logic_check ===
false) {
344 if ($this->canBypassPermissionsCheck(
$user_guid)) {
359 return $this->hooks->trigger(
'container_permissions_check',
$type,
$params, $return);
375 if ($this->canBypassPermissionsCheck(
$user_guid)) {
410 if ($annotation_name === null || $annotation_name ===
false) {
412 $annotation_name =
'';
413 }
elseif (!is_string($annotation_name)) {
417 if ($this->canBypassPermissionsCheck(
$user_guid)) {
427 $return = (bool)
$user;
432 'annotation_name' => $annotation_name,
435 if (!empty($annotation_name)) {
436 $return = $this->hooks->trigger(
"permissions_check:annotate:$annotation_name", $entity->
getType(),
$params, $return);
439 return $this->hooks->trigger(
'permissions_check:annotate', $entity->
getType(),
$params, $return);
454 if ($this->canBypassPermissionsCheck(
$user_guid)) {
469 return $this->hooks->trigger(
'permissions_check:download',
'file',
$params,
$default);
canDeleteRiverItem(ElggRiverItem $item, $user_guid=0)
Can a user delete this river item?
$params
Saves global plugin settings.
$annotation
Elgg default annotation view.
canEditMetadata(ElggEntity $entity, $user_guid=0, ElggMetadata $metadata=null)
Can a user edit metadata on this entity?
canAnnotate(ElggEntity $entity, $user_guid=0, $annotation_name= '')
Can a user annotate an entity?
__construct(PluginHooksService $hooks, EntityTable $entities, ElggSession $session)
Constructor.
canEdit($user_guid=0)
Can a user edit this entity?
$user_guid
Validate a user.
canDownload(ElggFile $entity, $user_guid=0, $default=true)
Can a user download a file?
canDelete(ElggEntity $entity, $user_guid=0)
Can a user delete this entity?
Exception indicating a user could not be looked up for a permissions check.
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Log a notice about deprecated use of a function, view, etc.
if($item instanceof\ElggEntity) elseif($item instanceof\ElggRiverItem) elseif(is_callable([$item, 'getType']))
canComment(ElggEntity $entity, $user_guid=0, $default=null)
Can a user comment on an entity?
canEditAnnotation(ElggEntity $entity, $user_guid=0, ElggAnnotation $annotation=null)
Determines whether or not the user can edit this annotation.
getType()
Returns the entity type.
if(elgg_extract('hidden', $vars, true)) $attrs
getOriginalAttributes()
Get the original values of attribute(s) that have been modified since the entity was persisted...
canWriteToContainer(ElggEntity $entity, $user_guid=0, $type= 'all', $subtype= 'all')
Can a user add an entity to this container.
canEdit(ElggEntity $entity, $user_guid=0)
Can a user edit this entity?
canBypassPermissionsCheck($user_guid=0)
Decides if the access system should be ignored for a user.