rhtyd commented on a change in pull request #4316:
URL: https://github.com/apache/cloudstack/pull/4316#discussion_r486119214
##########
File path: server/src/main/java/com/cloud/acl/DomainChecker.java
##########
@@ -199,6 +200,9 @@ public boolean checkAccess(Account caller, ControlledEntity
entity, AccessType a
private boolean checkOperationPermitted(Account caller, ControlledEntity
entity) {
User user = CallContext.current().getCallingUser();
Project project =
projectDao.findByProjectAccountId(entity.getAccountId());
+ if (project == null) {
Review comment:
Are there usage of this method where throwing an exception would break
flow? (or, are we expecting all usages of this method to be project related?)
##########
File path: server/src/main/java/com/cloud/network/NetworkModelImpl.java
##########
@@ -1658,6 +1658,9 @@ public void checkNetworkPermissions(Account owner,
Network network) {
if (owner.getType() != Account.ACCOUNT_TYPE_PROJECT &&
networkOwner.getType() == Account.ACCOUNT_TYPE_PROJECT) {
User user = CallContext.current().getCallingUser();
Project project =
projectDao.findByProjectAccountId(network.getAccountId());
+ if (project == null) {
Review comment:
Same as previous comment
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]