MCPcopy
hub / github.com/chartbrew/chartbrew / resolveRuntimeVariables

Function resolveRuntimeVariables

server/api/ChartRoute.js:155–177  ·  view source on GitHub ↗
(req, project, providedVariables = {})

Source from the content-addressed store, hash-verified

153 };
154
155 const resolveRuntimeVariables = async (req, project, providedVariables = {}) => {
156 const queryParams = req.body?.queryParams || {};
157 const urlVariables = projectController._extractVariablesFromQuery(queryParams);
158 let policyVariables = {};
159
160 const sharePolicy = await db.SharePolicy.findOne({
161 where: {
162 entity_type: "Project",
163 entity_id: project.id,
164 },
165 });
166
167 if (sharePolicy) {
168 policyVariables = projectController._mergeVariablesWithPolicy(urlVariables, sharePolicy);
169 } else if (project.public) {
170 policyVariables = urlVariables;
171 }
172
173 return {
174 ...policyVariables,
175 ...(providedVariables || {}),
176 };
177 };
178
179 const checkPermissions = (actionType = "readOwn", entity = "chart") => {
180 return async (req, res, next) => {

Callers 1

ChartRoute.jsFile · 0.85

Calls 2

Tested by

no test coverage detected