ofekisr commented on a change in pull request #14015:
URL: https://github.com/apache/superset/pull/14015#discussion_r705441985
##########
File path: superset/models/dashboard.py
##########
@@ -397,6 +427,11 @@ def get(cls, id_or_slug: str) -> Dashboard:
qry = session.query(Dashboard).filter(id_or_slug_filter(id_or_slug))
return qry.one_or_none()
+ def am_i_owner(self) -> bool:
+ if g.user is None or g.user.is_anonymous or not
g.user.is_authenticated:
+ return False
+ return g.user.id in set(map(lambda user: user.id, self.owners))
Review comment:
> IMO `is_actor_owner()` would be a more appropriate name for this
method.
agree
--
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]