kunwp1 commented on code in PR #8890:
URL: https://github.com/apache/texera/pull/8890#discussion_r4274201796
##########
common/resource/src/main/scala/org/apache/texera/service/resource/ResourceAccess.scala:
##########
@@ -257,6 +257,7 @@ object ResourceAccess {
throw new BadRequestException(s"No registered user with email $email")
}
val granteeUid = grantee.getUid
+ requireNotOwner(ctx, resource, id, granteeUid)
Review Comment:
One thing to consider: owners who were already downgraded or removed before
this fix can no longer be repaired. Is this problem an existing case in our
deployments or local development environments? If that's the case, can you add
a one-time SQL migration script that restores WRITE for every dataset and
model? The reason is owners who were already damaged are stuck forever even
after the fix.
##########
common/resource/src/main/scala/org/apache/texera/service/resource/ResourceAccess.scala:
##########
@@ -311,6 +314,16 @@ object ResourceAccess {
)
}
+ private def requireNotOwner[R <: Record, A <: Record](
Review Comment:
Can we just treat the owner as WRITE in those read spots, so a bad row can
never affect the owner and old bad rows would heal without a migration instead?
--
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]