<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def manager_required(func=None):
 """ Decorator for views that require not only a team but also that a user be logged in and be the manager or owner of that team. """

    def decorator(view_func):
        @team_required
        @login_required
        @functools.wraps(view_func, assigned=available_attrs(view_func))
        def _wrapped_view(request, *args, **kwargs):
            role = request.team.role_for(request.user)
            if role not in [Membership.ROLE_MANAGER, Membership.ROLE_OWNER]:
                raise Http404()
            return view_func(request, *args, **kwargs)
        return _wrapped_view
    if func:
        return decorator(func)
    return decorator