def load_user(uid): return user_from_id(uid)
def on_identity_loaded(sender, identity): user = user_from_id(identity._id) identity.provides.add(RoleNeed(user.access_level)) identity.user = user g.user = user