Further modules included.
[yaffs-website] / web / modules / contrib / linkchecker / src / Controller / LinkCheckerUserReportPage.php
1 <?php
2
3 namespace Drupal\linkchecker\Controller;
4
5 use Drupal\Core\Session\AccountInterface;
6 use Symfony\Component\HttpFoundation\Request;
7
8 /**
9  * Builds user broken link report page.
10  */
11 class LinkCheckerUserReportPage {
12
13   public function content() {
14     return '@TODO';
15   }
16
17   /**
18    * Checks access for a specific request.
19    *
20    * @param \Drupal\Core\Session\AccountInterface $account
21    *   Run access checks for this account.
22    */
23   public function access(AccountInterface $account) {
24     $user = \Drupal::currentUser();
25
26     // Users with 'access own broken links report' permission can only view their
27     // own report. Users with the 'access broken links report' permission can
28     // view the report for any authenticated user.
29     return AccessResult::allowedIf($account->id() && (($user->id()) == $account->id()) && $account->hasPermission('access own broken links report') || $account->hasPermission('access broken links report'));
30   }
31
32 }