+ # Required: the user must have an authority in its user.config
+ # XXX Temporary solution
+ user_query = Query().get('local:user').select('config','email')
+ user_details = execute_query(self.request, user_query)
+
+ # not always found in user_details...
+ config={}
+# for user_detail in user_details:
+# #email = user_detail['email']
+# if user_detail['config']:
+# config = json.loads(user_detail['config'])
+# user_detail['authority'] = config.get('authority',"Unknown Authority")
+#
+# if user_detail['authority'] is not None:
+# sub_authority = user_detail['authority'].split('.')
+# root_authority = sub_authority[0]
+# query_user_all = Query.get(root_authority+':user').select(user_fields)
+#
+# # XXX TODO this filter doesn't work - to be improved in Manifold
+# #.filter_by('authority.authority_hrn', '=', user_detail['authority'])
+#
+# page.enqueue_query(query_user_all)
+# else:
+# print "authority of the user is not in local:user db"
+ query_user_all = Query.get('user').select(user_fields)
+ # query_user_all = None