Skip to content

Commit 88d298f

Browse files
committed
add back access checks
1 parent 376ac43 commit 88d298f

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

server/src/main/java/com/cloud/storage/snapshot/SnapshotManagerImpl.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,6 +1399,13 @@ public Pair<List<? extends SnapshotPolicy>, Integer> listSnapshotPolicies(ListSn
13991399
Boolean isRecursive = null;
14001400
ListProjectResourcesCriteria listProjectResourcesCriteria = null;
14011401

1402+
if (volumeId != null) {
1403+
VolumeVO volume = _volsDao.findById(volumeId);
1404+
if (volume != null) {
1405+
_accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, true, volume);
1406+
}
1407+
}
1408+
14021409
if (!isRootAdmin) {
14031410
Ternary<Long, Boolean, ListProjectResourcesCriteria> domainIdRecursiveListProject =
14041411
new Ternary<>(cmd.getDomainId(), cmd.isRecursive(), null);

server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,12 @@ public List<BackupSchedule> listBackupSchedules(ListBackupScheduleCmd cmd) {
648648
Boolean isRecursive = null;
649649
Project.ListProjectResourcesCriteria listProjectResourcesCriteria = null;
650650

651+
if (vmId != null) {
652+
final VMInstanceVO vm = findVmById(vmId);
653+
validateBackupForZone(vm.getDataCenterId());
654+
accountManager.checkAccess(CallContext.current().getCallingAccount(), null, true, vm);
655+
}
656+
651657
if (!isRootAdmin) {
652658
Ternary<Long, Boolean, Project.ListProjectResourcesCriteria> domainIdRecursiveListProject =
653659
new Ternary<>(cmd.getDomainId(), cmd.isRecursive(), null);

0 commit comments

Comments
 (0)