- def check_conflict_on_new(self, session, indata, force=False):
+ @staticmethod
+ def _get_project_filter(session):
+ """
+ Generates a filter dictionary for querying database users.
+ Current policy is admin can show all, non admin, only its own user.
+ :param session: contains "username", "admin", "force", "public", "project_id", "set_project"
+ :return:
+ """
+ if session["admin"]: # allows all
+ return {}
+ else:
+ return {"_id.cont": session["project_id"]}
+
+ def check_conflict_on_new(self, session, indata):