original_string: private function GrantOnContent(Content $content, BackendAction $action)
      {
          if ($this->GetUser()->Equals($content->GetUser()))
          {
              return GrantResult::Allowed();
          }
          $contentRights = RightsFinder::FindContentRights($content);
          $contentGroup = GroupFinder::FindContentGroup($content);
          if (!$contentRights || !$contentGroup)
          {
              return GrantResult::NoAccess();
          }
          $groups = $this->GetGroups();
          foreach ($groups as $group)
          {
              $result = $this->GrantGroupOnContent($group, $contentGroup, $contentRights, $action);
              if ($result->Equals(GrantResult::Allowed()))
              {
                  return $result;
              }
          }
          return GrantResult::NoAccess();
      }
code: private function GrantOnContent(Content $content, BackendAction $action)
      {
          if ($this->GetUser()->Equals($content->GetUser()))
          {
              return GrantResult::Allowed();
          }
          $contentRights = RightsFinder::FindContentRights($content);
          $contentGroup = GroupFinder::FindContentGroup($content);
          if (!$contentRights || !$contentGroup)
          {
              return GrantResult::NoAccess();
          }
          $groups = $this->GetGroups();
          foreach ($groups as $group)
          {
              $result = $this->GrantGroupOnContent($group, $contentGroup, $contentRights, $action);
              if ($result->Equals(GrantResult::Allowed()))
              {
                  return $result;
              }
          }
          return GrantResult::NoAccess();
      }
code_tokens: private function GrantOnContent ( Content $ content , BackendAction $ action ) { if ( $ this -> GetUser ( ) -> Equals ( $ content -> GetUser ( ) ) ) { return GrantResult :: Allowed ( ) ; } $ contentRights = RightsFinder :: FindContentRights ( $ content ) ; $ contentGroup = GroupFinder :: FindContentGroup ( $ content ) ; if ( ! $ contentRights || ! $ contentGroup ) { return GrantResult :: NoAccess ( ) ; } $ groups = $ this -> GetGroups ( ) ; foreach ( $ groups as $ group ) { $ result = $ this -> GrantGroupOnContent ( $ group , $ contentGroup , $ contentRights , $ action ) ; if ( $ result -> Equals ( GrantResult :: Allowed ( ) ) ) { return $ result ; } } return GrantResult :: NoAccess ( ) ; }
docstring: Calculates the grant result for a content
  @param Content $content The content
  @param BackendAction $action The action that shall be taken on the content
  @return GrantResult Returns the calculated grant result
docstring_tokens: Calculates the grant result for a content