MCPcopy Index your code
hub / github.com/diffgram/diffgram / api_user_has_credentials

Function api_user_has_credentials

default/methods/user/user_has_credentials.py:18–56  ·  view source on GitHub ↗

List all the discussion based on the given filters. We can filter by job_id, task_id, file_id, status and project. :param project_string_id: :return:

(project_string_id, user_to_check_id)

Source from the content-addressed store, hash-verified

16@Project_permissions.user_has_project(Roles = ["admin", "Editor", "allow_if_project_is_public", "annotator"],
17 apis_user_list = ["api_enabled_builder"])
18def api_user_has_credentials(project_string_id, user_to_check_id) -> [Response, int]:
19 """
20 List all the discussion based on the given filters.
21 We can filter by job_id, task_id, file_id, status and project.
22 :param project_string_id:
23 :return:
24 """
25 spec_list = [
26 {"task_template_id": {
27 'kind': str,
28 "required": True
29 }},
30 ]
31 data = request.args
32
33 log = regular_log.default()
34 log, input = regular_input.input_check_many(
35 log = log,
36 untrusted_input = data,
37 spec_list = spec_list)
38
39 if len(log["error"].keys()) >= 1:
40 return jsonify(log = log), 400
41
42 with sessionMaker.session_scope() as session:
43
44 project = Project.get_by_string_id(session, project_string_id)
45 user = User.get_by_id(session, user_to_check_id)
46 credentials_data, log = user_has_credentials_core(
47 session = session,
48 log = log,
49 user = user,
50 project = project,
51 task_template_id = input['task_template_id']
52 )
53 if len(log["error"].keys()) >= 1:
54 return jsonify(log = log), 400
55
56 return jsonify(credentials_data), 200
57
58
59def user_has_credentials_core(session: object,

Callers

nothing calls this directly

Calls 3

get_by_string_idMethod · 0.45
get_by_idMethod · 0.45

Tested by

no test coverage detected