Skip to content

Commit c3c6d34

Browse files
winterhazelPearl1594
authored andcommitted
Add access validation to Quota email APIs
1 parent 64d83ce commit c3c6d34

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaConfigureEmailCmd.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.apache.cloudstack.api.command;
1818

1919
import com.cloud.utils.Pair;
20+
import org.apache.cloudstack.api.ACL;
2021
import org.apache.cloudstack.api.APICommand;
2122
import org.apache.cloudstack.api.ApiConstants;
2223
import org.apache.cloudstack.api.BaseCmd;
@@ -32,6 +33,7 @@
3233
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
3334
public class QuotaConfigureEmailCmd extends BaseCmd {
3435

36+
@ACL
3537
@Parameter(name = ApiConstants.ACCOUNT_ID, type = CommandType.UUID, entityType = AccountResponse.class, required = true,
3638
description = "Account ID for which to configure quota template email or min balance")
3739
private long accountId;

plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaListEmailConfigurationCmd.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
//under the License.
1717
package org.apache.cloudstack.api.command;
1818

19-
import com.cloud.user.Account;
19+
import org.apache.cloudstack.api.ACL;
2020
import org.apache.cloudstack.api.APICommand;
2121
import org.apache.cloudstack.api.ApiConstants;
2222
import org.apache.cloudstack.api.BaseCmd;
@@ -32,6 +32,7 @@
3232
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
3333
public class QuotaListEmailConfigurationCmd extends BaseCmd {
3434

35+
@ACL
3536
@Parameter(name = ApiConstants.ACCOUNT_ID, type = BaseCmd.CommandType.UUID, entityType = AccountResponse.class, required = true,
3637
description = "Account ID for which to list quota template email configurations")
3738
private long accountId;
@@ -49,6 +50,6 @@ public void execute() {
4950

5051
@Override
5152
public long getEntityOwnerId() {
52-
return Account.ACCOUNT_ID_SYSTEM;
53+
return accountId;
5354
}
5455
}

0 commit comments

Comments
 (0)