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

Issue #3181199 by yas: Fix the owner field in each resource (6) (Key Pair) (List)

parent ed539adc
No related branches found
No related tags found
No related merge requests found
......@@ -1023,6 +1023,23 @@ function aws_cloud_query_aws_cloud_elastic_ip_views_access_alter(AlterableInterf
}
/**
* Implements hook_query_TAG_Alter().
*/
function aws_cloud_query_aws_cloud_key_pair_views_access_alter(AlterableInterface $query) {
if (!$account = $query->getMetaData('account')) {
$account = \Drupal::currentUser();
}
if ($account->hasPermission('view any aws cloud key pair')) {
return;
}
else {
// Add a uid condition.
$query->condition('aws_cloud_key_pair.uid', $account->id());
}
}
/**
* Implements hook_query_TAG_Alter().
*/
......
......@@ -31,7 +31,7 @@ class KeyPairViewsData extends AwsCloudViewsData {
'key_fingerprint',
];
$data['aws_cloud_snapshot']['table']['base']['access query tag'] = 'aws_cloud_key_pair_views_access';
$data['aws_cloud_key_pair']['table']['base']['access query tag'] = 'aws_cloud_key_pair_views_access';
$this->addDropdownSelector($data, $table_name, $fields, $selectable);
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