oncall-engine/engine/apps/grafana_plugin/helpers
Joey Orlando babacf4da8
refactor the is_rbac_permissions_enabled check to be more robust (#1099)
# What this PR does
Checks the `is_rbac_permissions_enabled` flag differently based on
whether we are dealing with an open-source, or cloud installation:
- for open-source installations, simply continue making a `HEAD` request
to the list RBAC permissions Grafana API endpoint.
- for cloud installations, use the `config` object returned from `GET
/instances/{instance_id}?config=true` and check whether
`instance_info["config"]["feature_toggles"]["accessControlOnCall"] ==
"true"`

## Which issue(s) this PR fixes
Resolves the issue in hosted grafana where when a stack is inactive, the
hosted grafana gateway, returns 200 to the `HEAD` request (which
erroneously sets the `is_rbac_permissions_enabled` flag to `true`)

## Checklist

- [x] Tests updated (N/A)
- [ ] Documentation added
- [x] `CHANGELOG.md` updated
2023-01-11 12:48:30 +01:00
..
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
client.py refactor the is_rbac_permissions_enabled check to be more robust (#1099) 2023-01-11 12:48:30 +01:00
gcom.py remove is_rbac_permissions_enabled logic from check_gcom_permission function (#976) 2022-12-12 17:05:44 +01:00