Skip to content

Add error handling for sec config license fetch

On the "Security & Compliance" configuration page we use a GraphQL query (currentLicense) to fetch the current instance's plan tier.

We then use the response to either show (on "Ultimate") or hide the tab that shows the security-training related settings:

Screen_Shot_2022-05-05_at_1.20.04_pm

Currently on production this query returns an error, unless the current user has the "admin" role. This causes the configuration security-training section be hidden for all non-admin users. (more info on internal slack channel: https://gitlab.slack.com/archives/C6MLS3XEU/p1651709364760349)

This commit adds an error handler to the query, which will make sure that any query-failure does not result in the feature being hidden.

It will somewhat revert the changes from !85768 (merged) , but fixing this should be addressed separately. By either changing the permissions for the currently used query (currentLicense), or use a different means to determine how to display the security-training configuration.

Edited by Daniel Tian

Merge request reports

Loading