class BBBMeetingModeratorAccessCheck in BigBlueButton 8
Class BBBMeetingModeratorAccessCheck.
@package Drupal\bbb\Access
Hierarchy
- class \Drupal\bbb_node\Access\BBBMeetingModeratorAccessCheck implements AccessInterface
Expanded class hierarchy of BBBMeetingModeratorAccessCheck
1 string reference to 'BBBMeetingModeratorAccessCheck'
- bbb_node.services.yml in modules/
bbb_node/ bbb_node.services.yml - modules/bbb_node/bbb_node.services.yml
1 service uses BBBMeetingModeratorAccessCheck
File
- modules/
bbb_node/ src/ Access/ BBBMeetingModeratorAccessCheck.php, line 18
Namespace
Drupal\bbb_node\AccessView source
class BBBMeetingModeratorAccessCheck implements AccessInterface {
/**
* Node based Meeting API.
*
* @var \Drupal\bbb_node\Service\NodeMeeting
*/
protected $nodeMeeting;
/**
* Node storage.
*
* @var \Drupal\Core\Entity\EntityStorageInterface
*/
protected $nodeStorage;
/**
* Constructs a BBBMeetingModeratorAccessCheck object.
*
* @param \Drupal\bbb_node\Service\NodeMeeting $node_meeting
* Node based Meeting API.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* Entity type manager.
*/
public function __construct(NodeMeeting $node_meeting, EntityTypeManagerInterface $entity_type_manager) {
$this->nodeMeeting = $node_meeting;
$this->nodeStorage = $entity_type_manager
->getStorage('node');
}
/**
* {@inheritdoc}
*/
public function access(RouteMatchInterface $route_match, AccountInterface $account) {
$node = $route_match
->getParameter('node');
if (!$node instanceof NodeInterface) {
$node = $this->nodeStorage
->load($node);
}
if (!$this->nodeMeeting
->isTypeOf($node)) {
return AccessResult::forbidden();
}
// Check for access to attend meetings.
if ($account
->hasPermission('bbb_node moderate meetings') || $account
->hasPermission('administer big blue button') || $account
->id() === $node
->getOwnerId() && $account
->hasPermission('bbb_node moderate own meetings')) {
return AccessResult::allowed();
}
return AccessResult::neutral();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BBBMeetingModeratorAccessCheck:: |
protected | property | Node based Meeting API. | |
BBBMeetingModeratorAccessCheck:: |
protected | property | Node storage. | |
BBBMeetingModeratorAccessCheck:: |
public | function | ||
BBBMeetingModeratorAccessCheck:: |
public | function | Constructs a BBBMeetingModeratorAccessCheck object. |