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.hidden_in_standard:
   add = False
  if (not icon.custom):
   if (icon.module_name == u'Learn'):
    pass
   elif ((icon.type == u'page') and (icon.link not in allowed_pages)):
    add = False
   elif ((icon.type == u'module') and (icon.module_name not in user_perms.allow_modules)):
    add = False
  if add:
   icons.append(icon)
 return icons

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 . hidden_in_standard : add = False if ( not icon . custom ) : if ( icon . module_name == u'Learn' ) : pass elif ( ( icon . type == u'page' ) and ( icon . link not in allowed_pages ) ) : add = False elif ( ( icon . type == u'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 .