sureshanaparti commented on code in PR #9572:
URL: https://github.com/apache/cloudstack/pull/9572#discussion_r1729047935
##########
server/src/main/java/com/cloud/event/ActionEventUtils.java:
##########
@@ -393,7 +395,10 @@ private static void populateFirstClassEntities(Map<String,
String> eventDescript
s_logger.trace("Caught exception while populating first class
entities for event bus, moving on");
}
}
-
}
+ public static long getOwnerAccountId(CallContext ctx, String eventType,
long callingAccountId) {
+ long accountId = ctx.getProject() != null &&
!EventTypes.EVENT_PROJECT_CREATE.equalsIgnoreCase(eventType) ?
ctx.getProject().getProjectAccountId() : callingAccountId; //This should be
the entity owner id rather than the Calling User Account Id.
Review Comment:
> What is the point of keeping `EVENT_PROJECT_CREATE` linked to caller?
Should EVENT_PROJECT_UPDATE/EVENT_PROJECT_DELETE also be linked to the caller
in the same way?
The Project & it's account is created for the first time by the caller (with
the event `EVENT_PROJECT_CREATE`) and project account doesn't exists that time.
So, i think, it's better to link with the caller. All other events post project
creation were linked to the project account only.
Will check if EVENT_PROJECT_UPDATE/EVENT_PROJECT_DELETE can be linked with
caller.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]