MCPcopy
hub / github.com/diffgram/diffgram / report_update_api

Function report_update_api

default/methods/report/report_update_api.py:28–62  ·  view source on GitHub ↗

security model assumes that validate_report_permissions_scope checks it / returns forbidden if not applicable. Not sure if we want to attach report_templates 1:1 to a dashboard or if we want this report_view pivot. Either way need report_template_id an

()

Source from the content-addressed store, hash-verified

26 Roles = ['normal_user'],
27 apis_user_list = ["builder"])
28def report_update_api():
29 """
30 security model
31 assumes that validate_report_permissions_scope
32 checks it / returns forbidden if not applicable.
33
34
35 Not sure if we want to attach report_templates 1:1 to a dashboard
36 or if we want this report_view pivot.
37 Either way need report_template_id and report_dashboard_id
38
39 """
40
41 log, input, untrusted_input = regular_input.master(
42 request = request,
43 spec_list = report_list_api_spec)
44
45 if len(log["error"].keys()) >= 1:
46 return jsonify(log = log), 400
47
48 with sessionMaker.session_scope() as session:
49
50 ### MAIN ###
51 report_runner = Report_Runner(
52 session = session,
53 report_template_id = input.get('report_template_id'),
54 member = None
55 )
56
57 if len(report_runner.log["error"].keys()) >= 1:
58 return jsonify(log = report_runner.log), 400
59
60 report_runner.validate_existing_report_id_permissions()
61
62 return jsonify(log = report_runner.log), 200

Callers

nothing calls this directly

Calls 3

Report_RunnerClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected