public static function canEditAnnotation($hook, $type, $permission, $params) {

		$annotation = elgg_extract('annotation', $params);
		$user = elgg_extract('user', $params);

		if ($annotation instanceof ElggAnnotation && $annotation->name == 'likes') {
			// only owners of original annotation (or users who can edit these owners)
			$ann_owner = $annotation->getOwnerEntity();
			return ($ann_owner && $ann_owner->canEdit($user->guid));
		}

		return $permission;
	}
public static function canEditAnnotation($hook, $type, $permission, $params) {

		$annotation = elgg_extract('annotation', $params);
		$user = elgg_extract('user', $params);

		if ($annotation instanceof ElggAnnotation && $annotation->name == 'likes') {
			// only owners of original annotation (or users who can edit these owners)
			$ann_owner = $annotation->getOwnerEntity();
			return ($ann_owner && $ann_owner->canEdit($user->guid));
		}

		return $permission;
	}
public static function canEditAnnotation ( $ hook , $ type , $ permission , $ params ) { $ annotation = elgg_extract ( 'annotation' , $ params ) ; $ user = elgg_extract ( 'user' , $ params ) ; if ( $ annotation instanceof ElggAnnotation && $ annotation -> name == 'likes' ) { // only owners of original annotation (or users who can edit these owners) $ ann_owner = $ annotation -> getOwnerEntity ( ) ; return ( $ ann_owner && $ ann_owner -> canEdit ( $ user -> guid ) ) ; } return $ permission ; }
Fixes editing permissions on likes

@param string $hook       "permissions_check"
@param string $type       "annotation"
@param bool   $permission Current permission
@param array  $params     Hook params
@return boolean
Fixes editing permissions on likes