Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release/0.4.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdalisue committed Apr 30, 2012
2 parents 3a01516 + e3ba238 commit 85647e5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,31 @@ Quick tutorial
``{% permission %}`` tag is exactuly same as ``{% if %}`` thus you can use
``{% elpermission %}`` for ``{% elif %}`` and ``{% else %}``.

5. ``permission_required`` decorator is used for object permission checking.
You can use the decorator as::

from permission.decorators import permission_required

# As class decorator
@permission_required('auth.change_user')
class UpdateAuthUserView(UpdateView):
# ...

# As method decorator
class UpdateAuthUserView(UpdateView):
@permission_required('auth.change_user')
def dispatch(self, request, *args, **kwargs):
# ...
# As function decorator
@permission_required('auth.change_user')
def update_auth_user(request, *args, **kwargs):
# ...

see more details in document comments on
``permission/decorators/__init__.py``



Role?
==========
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# vim: set fileencoding=utf-8 :
from setuptools import setup, find_packages

version = '0.4.4'
version = '0.4.5'

def read(filename):
import os.path
Expand Down

0 comments on commit 85647e5

Please sign in to comment.