original_string: public static function canUserModifyOrDelete($idSite, $annotation)
      {
          // user can save if user is admin or if has view access, is not anonymous & is user who wrote note
          $canEdit = Piwik::isUserHasWriteAccess($idSite)
              || (!Piwik::isUserIsAnonymous()
                  && Piwik::getCurrentUserLogin() == $annotation['user']);
          return $canEdit;
      }
code: public static function canUserModifyOrDelete($idSite, $annotation)
      {
          // user can save if user is admin or if has view access, is not anonymous & is user who wrote note
          $canEdit = Piwik::isUserHasWriteAccess($idSite)
              || (!Piwik::isUserIsAnonymous()
                  && Piwik::getCurrentUserLogin() == $annotation['user']);
          return $canEdit;
      }
code_tokens: public static function canUserModifyOrDelete ( $ idSite , $ annotation ) { // user can save if user is admin or if has view access, is not anonymous & is user who wrote note $ canEdit = Piwik :: isUserHasWriteAccess ( $ idSite ) || ( ! Piwik :: isUserIsAnonymous ( ) && Piwik :: getCurrentUserLogin ( ) == $ annotation [ 'user' ] ) ; return $ canEdit ; }
docstring: Returns true if the current user can modify or delete a specific annotation.
  
  A user can modify/delete a note if the user has write access for the site OR
  the user has view access, is not the anonymous user and is the user that
  created the note in question.
  
  @param int $idSite The site ID the annotation belongs to.
  @param array $annotation The annotation.
  @return bool
docstring_tokens: Returns true if the current user can modify or delete a specific annotation .