|
28 | 28 | import org.apache.cloudstack.acl.SecurityChecker; |
29 | 29 | import org.apache.cloudstack.affinity.AffinityGroup; |
30 | 30 | import org.apache.cloudstack.context.CallContext; |
| 31 | +import org.apache.cloudstack.query.QueryService; |
31 | 32 | import org.apache.cloudstack.resourcedetail.dao.DiskOfferingDetailsDao; |
32 | 33 | import org.apache.log4j.Logger; |
33 | 34 | import org.springframework.stereotype.Component; |
|
55 | 56 | import com.cloud.service.dao.ServiceOfferingDetailsDao; |
56 | 57 | import com.cloud.storage.LaunchPermissionVO; |
57 | 58 | import com.cloud.storage.dao.LaunchPermissionDao; |
58 | | -import com.cloud.template.TemplateManager; |
59 | 59 | import com.cloud.template.VirtualMachineTemplate; |
60 | 60 | import com.cloud.user.Account; |
61 | 61 | import com.cloud.user.AccountService; |
@@ -167,7 +167,7 @@ public boolean checkAccess(Account caller, ControlledEntity entity, AccessType a |
167 | 167 | throw new PermissionDeniedException("Domain Admin and regular users can modify only their own Public templates"); |
168 | 168 | } |
169 | 169 | } |
170 | | - } else if (TemplateManager.RestrictPublicTemplateAccessToDomain.value() && caller.getType() != Account.ACCOUNT_TYPE_ADMIN) { // public template can be used by other accounts in the same domain or in sub-domains, and domain admin of parent domains |
| 170 | + } else if (QueryService.RestrictPublicTemplateAccessToDomain.valueIn(caller.getDomainId()) && caller.getType() != Account.ACCOUNT_TYPE_ADMIN) { // public template can be used by other accounts in the same domain or in sub-domains, and domain admin of parent domains |
171 | 171 | if (caller.getDomainId() != owner.getDomainId() && !_domainDao.isChildDomain(owner.getDomainId(), caller.getDomainId())) { |
172 | 172 | if (caller.getType() == Account.ACCOUNT_TYPE_NORMAL || caller.getType() == Account.ACCOUNT_TYPE_PROJECT) { |
173 | 173 | throw new PermissionDeniedException(caller + "is not allowed to access the template " + template); |
|
0 commit comments