Skip to content

Commit

Permalink
Remove useless methods from security manager (#37889)
Browse files Browse the repository at this point in the history
* Remove useless methods from security manager

* Fix mypy

(cherry picked from commit fd4dfd8)
  • Loading branch information
vincbeck authored and ephraimbuddy committed Mar 6, 2024
1 parent a4fd211 commit 876a662
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@

if TYPE_CHECKING:
from airflow.api_connexion.types import APIResponse, UpdateMask
from airflow.www.security_manager import AirflowSecurityManagerV2


def _check_action_and_resource(sm: AirflowSecurityManagerV2, perms: list[tuple[str, str]]) -> None:
def _check_action_and_resource(sm: FabAirflowSecurityManagerOverride, perms: list[tuple[str, str]]) -> None:
"""
Check if the action or resource exists and otherwise raise 400.
Expand Down
17 changes: 0 additions & 17 deletions airflow/www/security_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,20 +344,3 @@ def _is_authorized_category_menu(self, category: str) -> Callable:
self._get_auth_manager_is_authorized_method(fab_resource_name=item)(action, resource_pk, user)
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("Only available if FAB auth manager is used")

def get_resource(self, name: str) -> Resource:
raise NotImplementedError("Only available if FAB auth manager is used")

def add_permissions_view(self, base_action_names, resource_name):
pass

def add_permissions_menu(self, resource_name):
pass

0 comments on commit 876a662

Please sign in to comment.