server: fix domain shared public template check (#6916)

Fixes #6885

Fixes the incorrect inverted check.

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
Abhishek Kumar 2022-11-25 14:19:16 +05:30 committed by GitHub
parent c8d27765d8
commit 6c436ec90e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -120,7 +120,7 @@ public class DomainChecker extends AdapterBase implements SecurityChecker {
*/
private void checkPublicTemplateAccess(VirtualMachineTemplate template, Account owner, Account caller){
if (!QueryService.SharePublicTemplatesWithOtherDomains.valueIn(owner.getDomainId()) ||
if (QueryService.SharePublicTemplatesWithOtherDomains.valueIn(owner.getDomainId()) ||
caller.getDomainId() == owner.getDomainId() ||
_domainDao.isChildDomain(owner.getDomainId(), caller.getDomainId())) {
return;