(self, user, script_name)
| 204 | @requires_admin_rights |
| 205 | @inject_user |
| 206 | def delete(self, user, script_name): |
| 207 | try: |
| 208 | self.application.config_service.delete_config(user, script_name) |
| 209 | except ConfigNotAllowedException: |
| 210 | LOGGER.warning( |
| 211 | f'Admin access to the script "{script_name}" is denied for {user.get_audit_name()}' |
| 212 | ) |
| 213 | respond_error(self, 403, 'Access to the script is denied') |
| 214 | return |
| 215 | except NotFoundException as e: |
| 216 | LOGGER.warning(f'Failed to delete script {script_name}', exc_info=True) |
| 217 | respond_error(self, 404, str(e)) |
| 218 | return |
| 219 | except InvalidAccessException as e: |
| 220 | raise tornado.web.HTTPError(403, reason=str(e)) from e |
| 221 | |
| 222 | |
| 223 | class AdminGetScriptCodeEndpoint(BaseRequestHandler): |
no test coverage detected