public function ActivityVisibilityAccess::query in Open Social 8
Same name and namespace in other branches
- 8.9 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php \Drupal\activity_viewer\Plugin\views\filter\ActivityVisibilityAccess::query()
- 8.2 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php \Drupal\activity_viewer\Plugin\views\filter\ActivityVisibilityAccess::query()
- 8.3 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php \Drupal\activity_viewer\Plugin\views\filter\ActivityVisibilityAccess::query()
- 8.4 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php \Drupal\activity_viewer\Plugin\views\filter\ActivityVisibilityAccess::query()
- 8.5 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php \Drupal\activity_viewer\Plugin\views\filter\ActivityVisibilityAccess::query()
- 8.6 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php \Drupal\activity_viewer\Plugin\views\filter\ActivityVisibilityAccess::query()
- 8.7 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php \Drupal\activity_viewer\Plugin\views\filter\ActivityVisibilityAccess::query()
- 8.8 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php \Drupal\activity_viewer\Plugin\views\filter\ActivityVisibilityAccess::query()
- 10.3.x modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php \Drupal\activity_viewer\Plugin\views\filter\ActivityVisibilityAccess::query()
- 10.0.x modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php \Drupal\activity_viewer\Plugin\views\filter\ActivityVisibilityAccess::query()
- 10.1.x modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php \Drupal\activity_viewer\Plugin\views\filter\ActivityVisibilityAccess::query()
- 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\filterCode
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.
}