Skip to content

Security training config: update to use license helper (frontend)

In this issue, we will

  • remove the license GraphQL query
  • update it to use the helper introduced in this issue > #358182 (closed).
    • We will pass this value in HAML to Vue via the data-attribute

Notes

For reference, we can follow the jira implementation

#357327 (comment 901804367)

here is an example of how we solved this with the jira-issues for vulnerabilities, which also shows a different UI for non-ultimate users:

app/assets/javascripts/integrations/edit/components/jira_issues_fields.vue

The data to determine if the feature is available is coming from the backend via the HAML template, I think this is doing the check:

https://gitlab.com/gitlab-org/gitlab/-/blob/7e79d9c0c7d9e6033793200dc18a270fc6f65efc/ee/app/models/ee/project.rb#L316

Mandatory Testing Requirement

Make sure to simulate the SaaS version of the product and conduct the following test when developing locally:

  1. export GITLAB_SIMULATE_SAAS=1 <- Simulate your development is GitLab.com, info
  2. git checkout 358182-send-security-training-enabled-using-backend
  3. gdk restart
  4. Admin > Settings > General > "Account and limit" > enable "Allow use of licensed EE features"

Now load the page > http://gdk.test:3000/sec-group/security-reports-ex/-/security/configuration?tab=vulnerability-management and make sure this does NOT happen.

license-check-error

Edited by Samantha Ming