def METHOD_NAME(
    name, condition=None, menu_text=None, menu_order=sys.maxsize
):
    """Decorator for a view, which registers it as a portal action.
    A portal action is a view which operates on a portal. After
    registration, it is accessible at URL
    /users/username/portal/?action=``name``. You can specify a ``condition``
    under which the action can be accessed. The action can also be added to
    the portal admin menu. In order to do that, you have to specify
    ``menu_text``. If ``condition`` is specified, the action will not be
    visible in the admin buttons unless it is satisfied.
    For portal actions, the following ``request`` attributes are set:
    - ``portal`` - :class:`oioioi.portals.models.Portal` for which the
                   action is called, also set in the template context
    - ``action`` - action name
    :param name: action name, shown in the URL
    :param condition: decides if the action is accessible
    :type condition: :class:`oioioi.base.permissions.Condition`
    :param menu_text: text to display in the portal admin menu
    :param menu_order: value determining the order of items in the portal
                       admin menu
    """
    return _register_portal_action(
        portal_actions,
        name,
        condition,
        menu_text,
        lambda request: portal_url(portal=request.portal, action=name),
        menu_order,
    )