Tripal
Public Member Functions | List of all members
Drupal\tripal\Access\TripalAccessOwnContentCheck Class Reference
Inheritance diagram for Drupal\tripal\Access\TripalAccessOwnContentCheck:
Inheritance graph
[legend]
Collaboration diagram for Drupal\tripal\Access\TripalAccessOwnContentCheck:
Collaboration graph
[legend]

Public Member Functions

 access (UserInterface $user, AccountInterface $account)
 

Detailed Description

Checks that users have access to only their own content given a user account and a permission to check if it's their content. Permission is only granted if it's the users content and they have the passed in permission.

Note: This can only be used on paths with the {user} slug

Member Function Documentation

◆ access()

Drupal\tripal\Access\TripalAccessOwnContentCheck::access ( UserInterface  $user,
AccountInterface  $account 
)

The actual access check.

Parameters
Drupal\User\UserInterface$userThe user loaded from the slug in the route. This is the user who owns the content.
\Drupal\Core\Session\AccountInterface$accountRun access checks for this account. This is the user requesting access.
Returns
\Drupal\Core\Access\AccessResultInterface The access result.

The documentation for this class was generated from the following file: