aglinxinyuan commented on code in PR #9480:
URL: https://github.com/apache/texera/pull/9480#discussion_r4595871791


##########
common/resource/src/main/scala/org/apache/texera/service/resource/ResourceAccess.scala:
##########
@@ -136,7 +152,10 @@ object ResourceAccess {
       requesterUid: Integer
   ): String = {
     requireReadAccess(ctx, resource, id, requesterUid)
-    Option(owner(ctx, resource, id)).map(_.getEmail).getOrElse("")
+    ownerUid(ctx, resource, id)
+      .flatMap(uid => 
Option(ctx.select(USER.EMAIL).from(USER).where(USER.UID.eq(uid)).fetchOne()))
+      .map(_.value1())
+      .getOrElse("")

Review Comment:
   Folded the `owner` follow-up into this PR after all: 3086af5d18 replaces it 
with `ownerEmailOf`, which shares the `ownerEmail` join, so the twelve 
`DatasetResource`/`ModelResource` callers read only the email, and 
`ComputingUnitAccessResource.resolveUidByEmail` now uses `registeredUid` too. 
135ed83563 first pins an owner without an email, which still gets `null`.
   



-- 
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]

Reply via email to