src/ldt/ldt/auth/__init__.py
author verrierj
Fri, 02 Sep 2011 14:26:34 +0200
changeset 167 fe00e7302efe
parent 13 97ab7b3191cf
child 1191 b6e0b1811723
permissions -rw-r--r--
Change class and functions names to follow PEP8 formatting standards
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
167
fe00e7302efe Change class and functions names to follow PEP8 formatting standards
verrierj
parents: 13
diff changeset
     2
def check_access(user, obj):
fe00e7302efe Change class and functions names to follow PEP8 formatting standards
verrierj
parents: 13
diff changeset
     3
    check_meth = getattr(obj, 'check_access', False)
0
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
    if check_meth:
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
        return check_meth(user)
bdf22b140727 first import
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
    else:
13
97ab7b3191cf add api to update project, uses psiton
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
     7
        return user.is_staff