PHP Class Elgg\UserCapabilities

Use the elgg_* versions instead.
Since: 2.2
Show file Open project: elgg/elgg

Public Methods

Method Description
__construct ( PluginHooksService $hooks, EntityTable $entities, ElggSession $session ) Constructor
canAnnotate ( ElggEntity $entity, integer $user_guid, string $annotation_name = '' ) : boolean Can a user annotate an entity?
canComment ( ElggEntity $entity, integer $user_guid, boolean $default = null ) : boolean Can a user comment on an entity?
canDelete ( ElggEntity $entity, integer $user_guid ) : boolean Can a user delete this entity?
canDeleteRiverItem ( ElggRiverItem $item, integer $user_guid ) : boolean Can a user delete this river item?
canEdit ( ElggEntity $entity, integer $user_guid ) : boolean Can a user edit this entity?
canEditAnnotation ( ElggEntity $entity, integer $user_guid, ElggAnnotation $annotation = null ) : boolean Determines whether or not the user can edit this annotation
canEditMetadata ( ElggEntity $entity, integer $user_guid, ElggMetadata $metadata = null ) : boolean Can a user edit metadata on this entity?
canWriteToContainer ( ElggEntity $entity, integer $user_guid, string $type = 'all', string $subtype = 'all' ) : boolean Can a user add an entity to this container

Method Details

__construct() public method

Constructor
public __construct ( PluginHooksService $hooks, EntityTable $entities, ElggSession $session )
$hooks PluginHooksService Plugin hooks service
$entities Elgg\Database\EntityTable Entity table
$session ElggSession Session

canAnnotate() public method

Can a user annotate an entity?
public canAnnotate ( ElggEntity $entity, integer $user_guid, string $annotation_name = '' ) : boolean
$entity ElggEntity Objet entity
$user_guid integer User guid (default is logged in user)
$annotation_name string The name of the annotation (default is unspecified)
return boolean

canComment() public method

Can a user comment on an entity?
public canComment ( ElggEntity $entity, integer $user_guid, boolean $default = null ) : boolean
$entity ElggEntity Object entity
$user_guid integer User guid (default is logged in user)
$default boolean Default permission
return boolean

canDelete() public method

Can a user delete this entity?
See also: elgg_set_ignore_access()
Since: 1.11
public canDelete ( ElggEntity $entity, integer $user_guid ) : boolean
$entity ElggEntity Object entity
$user_guid integer The user GUID, optionally (default: logged in user)
return boolean Whether this entity is deletable by the given user.

canDeleteRiverItem() public method

Can a user delete this river item?
See also: elgg_set_ignore_access()
Since: 2.3
public canDeleteRiverItem ( ElggRiverItem $item, integer $user_guid ) : boolean
$item ElggRiverItem River item
$user_guid integer The user GUID, optionally (default: logged in user)
return boolean Whether this river item should be considered deletable by the given user.

canEdit() public method

Can a user edit this entity?
See also: elgg_set_ignore_access()
public canEdit ( ElggEntity $entity, integer $user_guid ) : boolean
$entity ElggEntity Object entity
$user_guid integer The user GUID, optionally (default: logged in user)
return boolean Whether this entity is editable by the given user.

canEditAnnotation() public method

Determines whether or not the user can edit this annotation
See also: elgg_set_ignore_access()
public canEditAnnotation ( ElggEntity $entity, integer $user_guid, ElggAnnotation $annotation = null ) : boolean
$entity ElggEntity Object entity
$user_guid integer The GUID of the user (defaults to currently logged in user)
$annotation ElggAnnotation Annotation
return boolean

canEditMetadata() public method

If no specific metadata is passed, it returns whether the user can edit any metadata on the entity.
See also: elgg_set_ignore_access()
public canEditMetadata ( ElggEntity $entity, integer $user_guid, ElggMetadata $metadata = null ) : boolean
$entity ElggEntity Object entity
$user_guid integer The user GUID, optionally (default: logged in user)
$metadata ElggMetadata The piece of metadata to specifically check or null for any metadata
return boolean

canWriteToContainer() public method

Can a user add an entity to this container
See also: elgg_set_ignore_access()
public canWriteToContainer ( ElggEntity $entity, integer $user_guid, string $type = 'all', string $subtype = 'all' ) : boolean
$entity ElggEntity Container entity
$user_guid integer The GUID of the user creating the entity (0 for logged in user).
$type string The type of entity we're looking to write
$subtype string The subtype of the entity we're looking to write
return boolean