oncall-engine/engine/apps/grafana_plugin
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
..
helpers refactor the is_rbac_permissions_enabled check to be more robust (#1099) 2023-01-11 12:48:30 +01:00
tasks Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00
tests refactor the is_rbac_permissions_enabled check to be more robust (#1099) 2023-01-11 12:48:30 +01:00
views Org soft-delete (#1073) 2023-01-05 12:42:55 +08:00
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
apps.py Get rid of installation token + add a bunch of tests (#624) 2022-11-21 16:26:00 +01:00
permissions.py Get rid of installation token + add a bunch of tests (#624) 2022-11-21 16:26:00 +01:00
urls.py Get rid of installation token + add a bunch of tests (#624) 2022-11-21 16:26:00 +01:00