You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by pe...@apache.org on 2025/05/27 14:40:34 UTC
(cloudstack) 02/05: Add access validation to Quota email APIs
This is an automated email from the ASF dual-hosted git repository.
pearl11594 pushed a commit to branch 4.20
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
commit c3c6d3458930319fc50c0f2f0a91602f373a59d0
Author: Fabricio Duarte <fa...@gmail.com>
AuthorDate: Thu Jan 16 11:10:40 2025 -0300
Add access validation to Quota email APIs
---
.../org/apache/cloudstack/api/command/QuotaConfigureEmailCmd.java | 2 ++
.../cloudstack/api/command/QuotaListEmailConfigurationCmd.java | 5 +++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaConfigureEmailCmd.java b/plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaConfigureEmailCmd.java
index 01d9ffc1529..f658783179f 100644
--- a/plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaConfigureEmailCmd.java
+++ b/plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaConfigureEmailCmd.java
@@ -17,6 +17,7 @@
package org.apache.cloudstack.api.command;
import com.cloud.utils.Pair;
+import org.apache.cloudstack.api.ACL;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
@@ -32,6 +33,7 @@ import javax.inject.Inject;
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
public class QuotaConfigureEmailCmd extends BaseCmd {
+ @ACL
@Parameter(name = ApiConstants.ACCOUNT_ID, type = CommandType.UUID, entityType = AccountResponse.class, required = true,
description = "Account ID for which to configure quota template email or min balance")
private long accountId;
diff --git a/plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaListEmailConfigurationCmd.java b/plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaListEmailConfigurationCmd.java
index 8915158461f..294738a7b99 100644
--- a/plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaListEmailConfigurationCmd.java
+++ b/plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaListEmailConfigurationCmd.java
@@ -16,7 +16,7 @@
//under the License.
package org.apache.cloudstack.api.command;
-import com.cloud.user.Account;
+import org.apache.cloudstack.api.ACL;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseCmd;
@@ -32,6 +32,7 @@ import javax.inject.Inject;
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
public class QuotaListEmailConfigurationCmd extends BaseCmd {
+ @ACL
@Parameter(name = ApiConstants.ACCOUNT_ID, type = BaseCmd.CommandType.UUID, entityType = AccountResponse.class, required = true,
description = "Account ID for which to list quota template email configurations")
private long accountId;
@@ -49,6 +50,6 @@ public class QuotaListEmailConfigurationCmd extends BaseCmd {
@Override
public long getEntityOwnerId() {
- return Account.ACCOUNT_ID_SYSTEM;
+ return accountId;
}
}