We have moved to Github. Please open tickets there.

Opened 3 years ago

Closed 2 years ago

#2569 closed Enhancement (fixed)

Add annotation permissions check

Reported by: ewinslow Owned by: cash
Priority: normal Milestone: Elgg 1.8.0
Component: Core Version: 1.7
Severity: minor Keywords:
Cc: brettp Difficulty: moderate

Description

Currently there is no way to control permission to annotate entities. We need a function for controlling annotation permission that is analagous to canWriteToContainer.

$entity::canAnnotate($user_guid, $name) {
    $params = array(
        'entity' => $this,
        'user' => get_user($user_guid),
    );
    return trigger_plugin_hook('permissions_check:annotate', $name, $params, FALSE);
}

I'd recommend defaulting it to FALSE because we don't want $entity->canAnnotate(0, 'idontexist') to return TRUE.

Change History (4)

comment:1 Changed 3 years ago by ewinslow

  • Milestone changed from Elgg 1.8 to Needs Review

comment:2 Changed 2 years ago by cash

  • Difficulty set to moderate
  • Milestone changed from Needs Review to Elgg 1.9

comment:3 Changed 2 years ago by cash

  • Milestone changed from Elgg 1.9 to Elgg 1.8
  • Owner set to cash
  • Status changed from new to assigned

needed for controlling liking

comment:4 Changed 2 years ago by cash

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [svn:8382]) fixes #2885 #2569 likes controlled by canAnnotate() with plugin hook

Note: See TracTickets for help on using tickets.