vincbeck commented on code in PR #33213:
URL: https://github.com/apache/airflow/pull/33213#discussion_r1295081179


##########
airflow/auth/managers/fab/fab_auth_manager.py:
##########
@@ -81,3 +148,35 @@ def get_url_user_profile(self) -> str | None:
         if not self.security_manager.user_view:
             return None
         return url_for(f"{self.security_manager.user_view.endpoint}.userinfo")
+
+    @staticmethod
+    def _get_fab_actions(action: ResourceAction) -> list[str]:
+        """
+        Convert the action to a list of FAB actions.
+
+        :param action: the action to convert
+
+        :meta private:
+        """
+        if action not in _MAP_ACTION_NAME_TO_FAB_ACTION_NAME:
+            raise AirflowException(f"Unknown action: {action}")
+        return _MAP_ACTION_NAME_TO_FAB_ACTION_NAME[action]
+
+    @staticmethod
+    def _resource_name_for_dag(dag_id: str) -> str:
+        """
+        Returns the FAB resource name for a DAG id.
+
+        Note that since a sub-DAG should follow the permission of its parent 
DAG, you should pass
+        ``DagModel.root_dag_id`` to this function, for a subdag. A normal dag 
should pass the
+        ``DagModel.dag_id``.

Review Comment:
   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]

Reply via email to