def permission_required(action):
def decorator(f):<EOL><INDENT>@wraps(f)<EOL>def inner(community, *args, **kwargs):<EOL><INDENT>permission = current_permission_factory(community, action=action)<EOL>if not permission.can():<EOL><INDENT>abort(<NUM_LIT>)<EOL><DEDENT>return f(community, *args, **kwargs)<EOL><DEDENT>return inner<EOL><DEDENT>return decorator<EOL>
Decorator to require permission.