Elgg
Version 2.3
|
WARNING: API IN FLUX. More...
Public Member Functions | |
__construct (PluginHooksService $hooks, EntityTable $entities, ElggSession $session) | |
Constructor. More... | |
canEdit (ElggEntity $entity, $user_guid=0) | |
Can a user edit this entity? More... | |
canDelete (ElggEntity $entity, $user_guid=0) | |
Can a user delete this entity? More... | |
canDeleteRiverItem (ElggRiverItem $item, $user_guid=0) | |
Can a user delete this river item? More... | |
canEditMetadata (ElggEntity $entity, $user_guid=0, ElggMetadata $metadata=null) | |
Can a user edit metadata on this entity? More... | |
canEditAnnotation (ElggEntity $entity, $user_guid=0, ElggAnnotation $annotation=null) | |
Determines whether or not the user can edit this annotation. More... | |
canWriteToContainer (ElggEntity $entity, $user_guid=0, $type= 'all', $subtype= 'all') | |
Can a user add an entity to this container. More... | |
canComment (ElggEntity $entity, $user_guid=0, $default=null) | |
Can a user comment on an entity? More... | |
canAnnotate (ElggEntity $entity, $user_guid=0, $annotation_name= '') | |
Can a user annotate an entity? More... | |
WARNING: API IN FLUX.
DO NOT USE DIRECTLY.
Use the elgg_* versions instead.
private
Definition at line 22 of file UserCapabilities.php.
Elgg\UserCapabilities::__construct | ( | PluginHooksService | $hooks, |
EntityTable | $entities, | ||
ElggSession | $session | ||
) |
Constructor.
PluginHooksService | $hooks | Plugin hooks service |
EntityTable | $entities | Entity table |
ElggSession | $session | Session |
Definition at line 46 of file UserCapabilities.php.
Elgg\UserCapabilities::canAnnotate | ( | ElggEntity | $entity, |
$user_guid = 0 , |
|||
$annotation_name = '' |
|||
) |
Can a user annotate an entity?
Can be overridden by registering for the plugin hook [permissions_check:annotate:<name>, <entity type>="">] or [permissions_check:annotate, <entity type>="">]. The hooks are called in that order.
If you want logged out users to annotate an object, do not call canAnnotate(). It's easier than using the plugin hook.
ElggEntity | $entity | Objet entity |
int | $user_guid | User guid (default is logged in user) |
string | $annotation_name | The name of the annotation (default is unspecified) |
Definition at line 352 of file UserCapabilities.php.
Elgg\UserCapabilities::canComment | ( | ElggEntity | $entity, |
$user_guid = 0 , |
|||
$default = null |
|||
) |
Can a user comment on an entity?
Can be overridden by registering for the permissions_check:comment, <entity type>=""> plugin hook.
ElggEntity | $entity | Object entity |
int | $user_guid | User guid (default is logged in user) |
bool | $default | Default permission |
Definition at line 321 of file UserCapabilities.php.
Elgg\UserCapabilities::canDelete | ( | ElggEntity | $entity, |
$user_guid = 0 |
|||
) |
Can a user delete this entity?
Can be overridden by registering for the permissions_check:delete plugin hook.
ElggEntity | $entity | Object entity |
int | $user_guid | The user GUID, optionally (default: logged in user) |
Definition at line 117 of file UserCapabilities.php.
Elgg\UserCapabilities::canDeleteRiverItem | ( | ElggRiverItem | $item, |
$user_guid = 0 |
|||
) |
Can a user delete this river item?
Can be overridden by registering for the "permissions_check:delete", "river" plugin hook.
ElggRiverItem | $item | River item |
int | $user_guid | The user GUID, optionally (default: logged in user) |
Definition at line 147 of file UserCapabilities.php.
Elgg\UserCapabilities::canEdit | ( | ElggEntity | $entity, |
$user_guid = 0 |
|||
) |
Can a user edit this entity?
Can be overridden by registering for the permissions_check plugin hook.
ElggEntity | $entity | Object entity |
int | $user_guid | The user GUID, optionally (default: logged in user) |
Definition at line 63 of file UserCapabilities.php.
Elgg\UserCapabilities::canEditAnnotation | ( | ElggEntity | $entity, |
$user_guid = 0 , |
|||
ElggAnnotation | $annotation = null |
||
) |
Determines whether or not the user can edit this annotation.
Elggentity | $entity | Object entity |
int | $user_guid | The GUID of the user (defaults to currently logged in user) |
ElggAnnotation | $annotation | Annotation |
Definition at line 221 of file UserCapabilities.php.
Elgg\UserCapabilities::canEditMetadata | ( | ElggEntity | $entity, |
$user_guid = 0 , |
|||
ElggMetadata | $metadata = null |
||
) |
Can a user edit metadata on this entity?
If no specific metadata is passed, it returns whether the user can edit any metadata on the entity.
Can be overridden by by registering for the permissions_check:metadata plugin hook.
ElggEntity | $entity | Object entity |
int | $user_guid | The user GUID, optionally (default: logged in user) |
ElggMetadata | $metadata | The piece of metadata to specifically check or null for any metadata |
Definition at line 179 of file UserCapabilities.php.
Elgg\UserCapabilities::canWriteToContainer | ( | ElggEntity | $entity, |
$user_guid = 0 , |
|||
$type = 'all' , |
|||
$subtype = 'all' |
|||
) |
Can a user add an entity to this container.
ElggEntity | $entity | Container entity |
int | $user_guid | The GUID of the user creating the entity (0 for logged in user). |
string | $type | The type of entity we're looking to write |
string | $subtype | The subtype of the entity we're looking to write |
Definition at line 266 of file UserCapabilities.php.