ActivityVisibilityAccess.php in Open Social 8.5
Same filename and directory in other branches
- 8.9 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php
- 8 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php
- 8.2 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php
- 8.3 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php
- 8.4 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php
- 8.6 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php
- 8.7 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php
- 8.8 modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php
- 10.3.x modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php
- 10.0.x modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php
- 10.1.x modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php
- 10.2.x modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.php
File
modules/custom/activity_viewer/src/Plugin/views/filter/ActivityVisibilityAccess.phpView source
<?php
namespace Drupal\activity_viewer\Plugin\views\filter;
use Drupal\views\Plugin\views\filter\FilterPluginBase;
/**
* Filters activity based on visibility settings.
*
* @ingroup views_filter_handlers
*
* @ViewsFilter("activity_visibility_access")
*/
class ActivityVisibilityAccess extends FilterPluginBase {
/**
* {@inheritdoc}
*/
public function canExpose() {
return FALSE;
}
/**
* 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
*/
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.
}
}
Classes
Name | Description |
---|---|
ActivityVisibilityAccess | Filters activity based on visibility settings. |