You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/09/10 07:21:12 UTC

[GitHub] [cloudstack] rhtyd commented on a change in pull request #4316: Handle listProjects API to list projects with user as Project Admin when listAll=true

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:
users@infra.apache.org