def get_user_icons(user):
	user_perms = UserPermissions(user)
	user_perms.build_permissions()

	from frappe.boot import get_allowed_pages

	allowed_pages = get_allowed_pages()

	icons = []
	for icon in get_desktop_icons(user):
		add = True
		if icon.blocked:
			add = False

		if not icon.custom:
			if icon.module_name=='Learn':
				pass

			elif icon.type=="page" and icon.link not in allowed_pages:
				add = False

			elif icon.type=="module" and icon.module_name not in user_perms.allow_modules:
				add = False

		if add:
			icons.append(icon)

	return icons
Get user icons for module setup page
dataset/ETHPy150Open frappe/frappe/frappe/core/page/modules_setup/modules_setup.py/get_user_icons