def check_access(user, obj): check_meth = getattr(obj, 'check_access', False) if check_meth: return check_meth(user) else: return user.is_staff