Skip to content

Prevent changing of an existing policy's type

Alexander Turinske requested to merge 273789-ensure-policy-change-works into master

What does this MR do?

Prevent changing of an existing policy's type

  • users should not be able to switch an existing policy's type
  • they should instead delete the policy and create a new one
  • abstract out code to be reused later
  • rename some constants
  • add tests

Screenshots (strongly suggested)

Page Before After
Policy Drawer Before it said Network Policy, which seems redundant Screen_Shot_2021-06-16_at_4.28.35_PM
Policy Editor for a new policy w/ scan_execution_policy_ui Screen_Shot_2021-06-16_at_3.57.03_PM No visual change
Policy Editor for an existing policy w/ scan_execution_policy_ui Previously the Type selection was not disabled Screen_Shot_2021-06-16_at_3.56.15_PM

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #273789 (closed)

Edited by Alexander Turinske

Merge request reports