import influxframework

from ..role import desk_properties


def execute():
	influxframework.reload_doctype("user")
	influxframework.reload_doctype("role")
	for role in influxframework.get_all("Role", ["name", "desk_access"]):
		role_doc = influxframework.get_doc("Role", role.name)
		for key in desk_properties:
			role_doc.set(key, role_doc.desk_access)
		role_doc.save()
