def has_perm_or_basicauth(perm, realm=''):
    "\n    This is similar to the above decorator 'logged_in_or_basicauth'\n    except that it requires the logged in user to have a specific\n    permission.\n\n    Use:\n\n    @logged_in_or_basicauth('asforums.view_forumcollection')\n    def your_view:\n        ...\n    "

    def view_decorator(func):

        def wrapper(request, *args, **kwargs):
            return view_or_basicauth(func, request, (lambda u: u.has_perm(perm)), realm, *args, **kwargs)
        return wrapper
    return view_decorator
This is similar to the above decorator 'logged_in_or_basicauth'
except that it requires the logged in user to have a specific
permission.

Use:

@logged_in_or_basicauth('asforums.view_forumcollection')
def your_view:
    ...
def has_perm_or_basicauth(perm, realm=):
    "\n    This is similar to the above decorator 'logged_in_or_basicauth'\n    except that it requires the logged in user to have a specific\n    permission.\n\n    Use:\n\n    @logged_in_or_basicauth('asforums.view_forumcollection')\n    def your_view:\n        ...\n    "

    def view_decorator(func):

        def wrapper(request, *args, **kwargs):
            return view_or_basicauth(func, request, (lambda u: u.has_perm(perm)), realm, *args, **kwargs)
        return wrapper
    return view_decorator