original_string: 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;
  	}
code: 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;
  	}
code_tokens: 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 ; }
docstring: 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
docstring_tokens: Fixes editing permissions on likes