vincbeck commented on code in PR #35488:
URL: https://github.com/apache/airflow/pull/35488#discussion_r1397591869
##########
airflow/www/security_manager.py:
##########
@@ -355,3 +347,20 @@ def _is_authorized_category_menu(self, category: str) ->
Callable:
return lambda action, resource_pk, user: any(
self._get_auth_manager_is_authorized_method(fab_resource_name=item) for item in
items
)
+
+ """
+ The following methods are specific to FAB auth manager. They still need to
be "present" in the main
+ security manager class, but they do nothing.
+ """
+
+ def get_action(self, name: str) -> Action:
+ raise NotImplementedError()
+
+ def get_resource(self, name: str) -> Resource:
+ raise NotImplementedError()
+
+ def add_permissions_view(self, base_action_names, resource_name):
+ pass
Review Comment:
Good question. This function (`add_permissions_view`) is called if
[update_fab_perms](https://airflow.apache.org/docs/apache-airflow/1.10.9/configurations-ref.html#update-fab-perms)
is `True`, which is the default value. If a user uses an auth manager
different than FAB auth manager and does not set `update_fab_perms` to `False`,
then they will get `NotImplementedError`. `pass` avoid that.
--
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]