Пример #1
0
def getSettingsForUser(username):
	if not userManager.enabled:
		return jsonify(SUCCESS)

	if current_user is None or current_user.is_anonymous() or (current_user.get_name() != username and not current_user.is_admin()):
		return make_response("Forbidden", 403)

	try:
		return jsonify(userManager.getAllUserSettings(username))
	except users.UnknownUser:
		return make_response("Unknown user: %s" % username, 404)
Пример #2
0
def getSettingsForUser(username):
    if not userManager.enabled:
        return jsonify(SUCCESS)

    if current_user is None or current_user.is_anonymous or (
            current_user.get_name() != username and not current_user.is_admin):
        return make_response("Forbidden", 403)

    try:
        return jsonify(userManager.getAllUserSettings(username))
    except users.UnknownUser:
        return make_response("Unknown user: %s" % username, 404)