Skip to content
Snippets Groups Projects
Commit ed539adc authored by Yas Naoi's avatar Yas Naoi Committed by Yas Naoi
Browse files

Issue #3180786 by yas, Xiaohua Guan, sekinet: Fix the owner field in each resource (5) (EIP) (List)

parent 0ef7d73a
No related branches found
No related tags found
No related merge requests found
...@@ -1006,6 +1006,23 @@ function aws_cloud_query_aws_cloud_image_views_access_alter(AlterableInterface $ ...@@ -1006,6 +1006,23 @@ function aws_cloud_query_aws_cloud_image_views_access_alter(AlterableInterface $
} }
/**
* Implements hook_query_TAG_Alter().
*/
function aws_cloud_query_aws_cloud_elastic_ip_views_access_alter(AlterableInterface $query) {
if (!$account = $query->getMetaData('account')) {
$account = \Drupal::currentUser();
}
if ($account->hasPermission('view any aws cloud elastic ip')) {
return;
}
else {
// Add a uid condition.
$query->condition('aws_cloud_elastic_ip.uid', $account->id());
}
}
/** /**
* Implements hook_query_TAG_Alter(). * Implements hook_query_TAG_Alter().
*/ */
......
...@@ -33,6 +33,7 @@ class ElasticIpViewsData extends AwsCloudViewsData { ...@@ -33,6 +33,7 @@ class ElasticIpViewsData extends AwsCloudViewsData {
'association_id', 'association_id',
]; ];
$data['aws_cloud_elastic_ip']['table']['base']['access query tag'] = 'aws_cloud_elastic_ip_views_access';
$this->addDropdownSelector($data, $table_name, $fields, $selectable); $this->addDropdownSelector($data, $table_name, $fields, $selectable);
return $data; return $data;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment