ofekisr commented on a change in pull request #16991:
URL: https://github.com/apache/superset/pull/16991#discussion_r758490311
##########
File path: superset/security/manager.py
##########
@@ -1047,17 +1048,23 @@ def raise_for_access(
assert datasource
- if not (
- self.can_access_schema(datasource)
- or self.can_access("datasource_access", datasource.perm or "")
- or (
- feature_flag_manager.is_feature_enabled("DASHBOARD_RBAC")
- and self.can_access_based_on_dashboard(datasource)
- )
- ):
- raise SupersetSecurityException(
- self.get_datasource_access_error_object(datasource)
- )
+ self.raise_when_there_is_no_access_to(datasource)
+
+ def raise_when_there_is_no_access_to(self, datasource: BaseDatasource) ->
None:
Review comment:
"raise_for_dashboard_acess" is even more bad name. what is mean
"dashboard_acess" ?
a better name conventions are on of those:
validate_<object_type>_can_be_accessed
or
actor_can_access_<object_type>
--
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]