rafaelweingartner commented on a change in pull request #2350: Cloudstack 10170 
- fixes resource tags security bugs and adds account tags support
URL: https://github.com/apache/cloudstack/pull/2350#discussion_r154618432
 
 

 ##########
 File path: server/src/com/cloud/tags/TaggedResourceManagerImpl.java
 ##########
 @@ -204,11 +206,27 @@ public long getResourceId(String resourceId, 
ResourceObjectType resourceType) {
             accountId = Account.ACCOUNT_ID_SYSTEM;
         }
 
-        if ((domainId == null) || ((accountId != null) && 
(domainId.longValue() == -1)))
+        if (domainId == null || domainId == -1)
         {
             domainId = _accountDao.getDomainIdForGivenAccountId(accountId);
         }
-        return new Pair<Long, Long>(accountId, domainId);
+        return new Pair<>(accountId, domainId);
+    }
+
+    private void checkResourceAccessible(Long accountId, Long domainId, String 
exceptionMessage) {
+        Account caller = CallContext.current().getCallingAccount();
+        if ((domainId != null) && (domainId == -1))
 
 Review comment:
   What about using java.util.Objects.equals(Object, Object) here? Then we do 
not need this `domainId != null`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to