Skip to content

Frontend: Refactor Security Configuration page after backend has been unified for CE & EE

Why are we doing this work

The Security Configuration page needs to show different information depending on the tier the given project is in. Currently, the logic of that behaviour is scattered in various places on the frontend and backend, which makes adding features or moving features to different tiers difficult and error-prone.

For instance, there's a check in the EE::Projects::Security::ConfigurationController that's a proxy for "are we in Ultimate?", and delegates to the CE controller in the negative case. That controller passes basically no information to the frontend (there's no ConfigurationPresenter instance exposed), and so the frontend has to branch on that, and hard-code some information and have some awkward type checks.

Instead, it would be better if the Security::ConfigurationController always presented the same structured information to the frontend. Then, the frontend could be simplified to render the information it's given, rather than making decisions itself about what to do given the lack of data.

In short, this would make adding to and modifying the Security Configuration page much simpler and faster.

Relevant links

Implementation plan (needs refinement)

  • Remove statically-defined configuration in frontend, e.g.:
  • Remove #js-security-configuration-static / #js-security-configuration distinction
  • By now, all tier/plan logic is purely in Ruby code (i.e., not even HAML).
Edited by Neil McCorrison