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

Issue #3014131 by shidat, yas, Xiaohua Guan: Comply with Drupal code standard: Error case Breaking

parent c47237ef
No related branches found
No related tags found
No related merge requests found
Showing
with 11 additions and 1 deletion
......@@ -17,6 +17,7 @@ function cloud_help($route_name, RouteMatchInterface $route_match) {
case 'help.page.cloud':
$output = '<p>' . t('The cloud module creates a user interface for users to manage clouds. Users can Create Instances, Describe Instances etc.') . '</p>';
return $output;
default:
return '';
}
......@@ -77,4 +78,4 @@ function cloud_views_pre_render(ViewExecutable $view) {
}
}
}
}
\ No newline at end of file
}
......@@ -219,6 +219,7 @@ class ApiController extends ControllerBase implements ApiControllerInterface {
case 'error':
$this->messenger->addError($message);
break;
case 'message':
$this->messenger->addMessage($message);
default:
......
......@@ -25,6 +25,7 @@ class ElasticIpAccessControlHandler extends EntityAccessControlHandler {
switch ($operation) {
case 'view':
return AccessResult::allowedIfHasPermissions($account, ['view aws cloud elastic ip', 'view ' . $entity->cloud_context()]);
case 'update':
case 'edit':
return AccessResult::allowedIfHasPermissions($account, ['edit aws cloud elastic ip', 'view ' . $entity->cloud_context()]);
......
......@@ -26,6 +26,7 @@ class ImageAccessControlHandler extends EntityAccessControlHandler {
switch ($operation) {
case 'view':
return AccessResult::allowedIfHasPermissions($account, ['view aws cloud image', 'view ' . $entity->cloud_context()]);
case 'update':
case 'edit':
return AccessResult::allowedIfHasPermissions($account, ['edit aws cloud image', 'view ' . $entity->cloud_context()]);
......
......@@ -26,6 +26,7 @@ class KeyPairAccessControlHandler extends EntityAccessControlHandler {
switch ($operation) {
case 'view':
return AccessResult::allowedIfHasPermissions($account, ['view aws cloud key pair', 'view ' . $entity->cloud_context()]);
case 'update':
case 'edit':
return AccessResult::allowedIfHasPermissions($account, ['edit aws cloud key pair', 'view ' . $entity->cloud_context()]);
......
......@@ -26,6 +26,7 @@ class NetworkInterfaceAccessControlHandler extends EntityAccessControlHandler {
switch ($operation) {
case 'view':
return AccessResult::allowedIfHasPermissions($account, ['view aws cloud network interface', 'view ' . $entity->cloud_context()]);
case 'update':
case 'edit':
return AccessResult::allowedIfHasPermissions($account, ['edit aws cloud network interface', 'view ' . $entity->cloud_context()]);
......
......@@ -26,6 +26,7 @@ class SecurityGroupAccessControlHandler extends EntityAccessControlHandler {
switch ($operation) {
case 'view':
return AccessResult::allowedIfHasPermissions($account, ['view aws cloud security group', 'view ' . $entity->cloud_context()]);
case 'update':
case 'edit':
return AccessResult::allowedIfHasPermissions($account, ['edit aws cloud security group', 'view ' . $entity->cloud_context()]);
......
......@@ -26,6 +26,7 @@ class SnapshotAccessControlHandler extends EntityAccessControlHandler {
switch ($operation) {
case 'view':
return AccessResult::allowedIfHasPermissions($account, ['view aws cloud snapshot', 'view ' . $entity->cloud_context()]);
case 'update':
case 'edit':
return AccessResult::allowedIfHasPermissions($account, ['edit aws cloud snapshot', 'view ' . $entity->cloud_context()]);
......
......@@ -26,9 +26,11 @@ class VolumeAccessControlHandler extends EntityAccessControlHandler {
switch ($operation) {
case 'view':
return AccessResult::allowedIfHasPermissions($account, ['view aws cloud volume', 'view ' . $entity->cloud_context()]);
case 'update':
case 'edit':
return AccessResult::allowedIfHasPermissions($account, ['edit aws cloud volume', 'view ' . $entity->cloud_context()]);
case 'delete':
return AccessResult::allowedIfHasPermissions($account, ['delete aws cloud volume', 'view ' . $entity->cloud_context()]);
}
......
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