Project

General

Profile

Actions

Feature #32881

closed

Expose previous application record revision through safemode

Added by Lukas Zapletal over 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Templates
Target version:
-
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Webhooks plugin needs to allow access to previous revisions which is very useful for hooking to database updates. This is safe to do thanks to audited gem, however, during testing I have found out that Safemode does not work properly. All our application record classes define Jail inner class from Safemode::Jail therefore all allowed methods defined in ApplicationRecord::Jail are completely ignored. Since the previous record revision can be safely enabled for all records, this must be also fixed.

Unfortunately, the change brings incompatibility to plugins which reopens the class, e.g. bootdisk and ansible, the exception is foreman_ansible/app/models/concerns/foreman_ansible/hostgroup_extensions.rb:50:in `<class:Hostgroup>': superclass mismatch for class Jail (TypeError) and to solve that, new plugin API method will be introduced so plugins can be fixed.

Actions

Also available in: Atom PDF