You are here

public function ActivityVisibilityAccess::query in Open Social 8

Same name and namespace in other branches
  1. 8.9 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php \Drupal\activity_viewer\Plugin\views\filter\ActivityVisibilityAccess::query()
  2. 8.2 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php \Drupal\activity_viewer\Plugin\views\filter\ActivityVisibilityAccess::query()
  3. 8.3 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php \Drupal\activity_viewer\Plugin\views\filter\ActivityVisibilityAccess::query()
  4. 8.4 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php \Drupal\activity_viewer\Plugin\views\filter\ActivityVisibilityAccess::query()
  5. 8.5 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php \Drupal\activity_viewer\Plugin\views\filter\ActivityVisibilityAccess::query()
  6. 8.6 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php \Drupal\activity_viewer\Plugin\views\filter\ActivityVisibilityAccess::query()
  7. 8.7 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php \Drupal\activity_viewer\Plugin\views\filter\ActivityVisibilityAccess::query()
  8. 8.8 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php \Drupal\activity_viewer\Plugin\views\filter\ActivityVisibilityAccess::query()
  9. 10.3.x modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php \Drupal\activity_viewer\Plugin\views\filter\ActivityVisibilityAccess::query()
  10. 10.0.x modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php \Drupal\activity_viewer\Plugin\views\filter\ActivityVisibilityAccess::query()
  11. 10.1.x modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php \Drupal\activity_viewer\Plugin\views\filter\ActivityVisibilityAccess::query()
  12. 10.2.x modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php \Drupal\activity_viewer\Plugin\views\filter\ActivityVisibilityAccess::query()

Currently use similar access as for the entity.

Probably want to extend this to entity access based on the node grant system when this is implemented. See https://www.drupal.org/node/777578

Overrides FilterPluginBase::query

File

modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php, line 30

Class

ActivityVisibilityAccess
Filters activity based on visibility settings.

Namespace

Drupal\activity_viewer\Plugin\views\filter

Code

public function query() {

  // We have a few scenarios:
  // 1. There is a recipient user and destination is only notification,
  // if current user is not recipient always deny access.
  // 2. There is a recipient group:
  // Check if the user has access to the related entity.
  // 3. There is a related entity of type node
  // Check if user has access to the related entity,
  // use node_access_grants system.
  // views filter content access with relationship to node
  // 4. There is a related entity of type post
  // Check if user has access to the post, we can use PostVisibilityAccess.
  // Note: in future we should implement entity grant system instead!
  // to support other entities as well.
}