legacy-dotfiles/.emacs.d/snippets/python-mode/permission_guard
Tom Willemsen 62ea1086e9 Emacs: Manually set-up w3m
Only `w3m-goto-url' and `w3m-bookmark-view' are ever really used to
start w3m, no need to load `w3m-load' for that.
2012-12-28 01:56:58 +01:00

9 lines
No EOL
388 B
Text

# -*- mode: snippet -*-
# name: Permission guard
# key: defm
# --
@method_decorator(permission_required('$1',
raise_exception=True))
def dispatch(self, *args, **kwargs):
'''Make sure the user has the $1 permission.'''
return super(${3:`(progn (re-search-backward "^[ \t]*class \\(.+\\)(") (match-string 1)))`}, self).dispatch(*args, **kwargs)