def permission(permission_required):

    def wrapper(func):

        def inner():
            setattr(func, 'permission_required', permission_required)
return func
return inner()
return wrapper
decorator to set attributes of function