Move resources view to FAB Auth manager
"""Whether the user has this role name."""
        if not isinstance(role_name_or_list, list):
            role_name_or_list = [role_name_or_list]
        return any(r.name in role_name_or_list for r in user.roles)
    def has_all_dags_access(self, user) -> bool:
        """
        Has all the dag access in any of the 3 cases:
        1. Role needs to be in (Admin, Viewer, User, Op).
        2. Has can_read action on dags resource.
        3. Has can_edit action on dags resource.
        """
        if not user:
            user = g.user
        return (
            self._has_role(["Admin", "Viewer", "Op", "User"], user)
            or self.can_read_all_dags(user)
            or self.can_edit_all_dags(user)
        )
    def can_edit_all_dags(self, user=None) -> bool: