(req, project, providedVariables = {})
| 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) => { |
no test coverage detected