nodes: 0, module; 1, function_definition; 2, function_name:get_user_permissions; 3, parameters; 4, block; 5, identifier:self; 6, identifier:user_id; 7, expression_statement; 8, expression_statement; 9, return_statement; 10, comment:"""Returns a sorted list of a users permissions"""; 11, assignment; 12, call; 13, identifier:permissions; 14, call; 15, identifier:sorted; 16, argument_list; 17, attribute; 18, argument_list; 19, identifier:permissions; 20, keyword_argument; 21, attribute; 22, identifier:getPermissions; 23, keyword_argument; 24, identifier:key; 25, call; 26, identifier:self; 27, identifier:user_service; 28, identifier:id; 29, identifier:user_id; 30, identifier:itemgetter; 31, argument_list; 32, string; 33, string_content:keyName
code: def get_user_permissions(self, user_id):
          """Returns a sorted list of a users permissions"""
          permissions = self.user_service.getPermissions(id=user_id)
          return sorted(permissions, key=itemgetter('keyName'))