src/ldt/ldt/auth/__init__.py
author verrierj
Mon, 06 Feb 2012 13:18:01 +0100
changeset 533 4d95862afbb2
parent 167 fe00e7302efe
child 1191 b6e0b1811723
permissions -rw-r--r--
Merge with 7bb62216b289599c8bf25e56fc066a435e2ec421
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