msyavuz commented on code in PR #40707:
URL: https://github.com/apache/superset/pull/40707#discussion_r3420499244


##########
superset/security/manager.py:
##########
@@ -4147,6 +4165,13 @@ def raise_for_ownership(self, resource: Model) -> None:
         owners = orig_resource.owners if hasattr(orig_resource, "owners") else 
[]
 
         if g.user.is_anonymous or g.user not in owners:
+            # Extension hook: check if the user is an extra owner
+            resolver = current_app.config.get("EXTRA_OWNERS_RESOLVER")
+            if resolver and not g.user.is_anonymous:
+                extra_owners = resolver(orig_resource)
+                if any(u.id == g.user.id for u in extra_owners):

Review Comment:
   Won't this raise AttributeError if the resolver returns dicts?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to