(path, content)
| 218 | has_admin_rights = self._authorizer.is_admin(user.user_id) |
| 219 | |
| 220 | def load_script(path, content) -> Optional[ShortConfig]: |
| 221 | try: |
| 222 | config_object = self.load_config_file(path, content) |
| 223 | short_config = script_config.read_short(path, config_object) |
| 224 | |
| 225 | if short_config is None: |
| 226 | return None |
| 227 | |
| 228 | if edit_mode and (not conf_service._can_edit_script(user, short_config)): |
| 229 | return None |
| 230 | |
| 231 | if (not edit_mode) and (not conf_service._can_access_script(user, short_config)): |
| 232 | return None |
| 233 | |
| 234 | return short_config |
| 235 | except json.decoder.JSONDecodeError: |
| 236 | LOGGER.exception(CorruptConfigFileException.VERBOSE_ERROR + ': ' + path) |
| 237 | return create_failed_short_config(path, has_admin_rights) |
| 238 | except Exception: |
| 239 | LOGGER.exception('Could not load script: ' + path) |
| 240 | |
| 241 | return self._visit_script_configs(load_script) |
| 242 |
nothing calls this directly
no test coverage detected