grafana/pkg/api
Gabriel MABILLE d4f682190f
AccessControl: Implement teams resource service (#43951)
* AccessControl: cover team permissions

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Add background service as a consumer to resource_services

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Define actions in roles.go

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Remove action from accesscontrol model

 Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* As suggested by kalle

* move some changes from branch to the skeleton PR

* Add background service as a consumer to resource_services

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* moving resourceservice to the main wire file pt2

* move team related actions so that they can be reused

* PR feedback

* fix

* typo

* Access Control: adding hooks for team member endpoints (#43991)

* AccessControl: cover team permissions

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Add background service as a consumer to resource_services

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Define actions in roles.go

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Remove action from accesscontrol model

 Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* As suggested by kalle

* add access control to list and add team member endpoint, and hooks for adding team members

* member permission type is 0

* add ID scope for team permission checks

* add more team actions, use Member for member permission name

* protect team member update endpoint with FGAC permissions

* update SQL functions for teams and the corresponding tests

* also protect team member removal endpoint with FGAC permissions and add a hook to permission service

* a few small fixes, provide team permission service to test setup

* AccessControl: cover team permissions

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Add background service as a consumer to resource_services

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Define actions in roles.go

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* Remove action from accesscontrol model

 Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>

* As suggested by kalle

* move some changes from branch to the skeleton PR

* remove resource services from wireexts

* remove unneeded actions

* linting fix

* remove comments

* feedback fixes

* feedback

* simplifying

* remove team member within the same transaction

* fix a mistake with the error

* call the correct sql fction

* linting

* Access control: tests for team member endpoints (#44177)

* tests for team member endpoints

* clean up and fix the tests

* fixing tests take 2

* don't import enterprise test license

* don't import enterprise test license

* remove unused variable

Co-authored-by: gamab <gabi.mabs@gmail.com>
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

Co-authored-by: ievaVasiljeva <ieva.vasiljeva@grafana.com>
2022-01-26 14:48:41 +00:00
..
apierrors Migrate to Wire for dependency injection (#32289) 2021-08-25 15:11:22 +02:00
avatar remove the global log error/warn etc functions (#41404) 2021-11-08 17:56:56 +01:00
datasource Chore: Remove unused Go code (#28852) 2020-11-17 11:51:31 +01:00
dtos Navigation: allow adding extra content (#44048) 2022-01-25 10:04:44 +02:00
frontendlogging Logger migration from log15 to gokit/log (#41636) 2022-01-06 22:28:05 +08:00
navlinks show admin nav link it the user only has permissions to view licensing and not other pages under admin node (#41948) 2021-11-19 11:02:13 +00:00
pluginproxy Chore: Fix attribute value (#44368) 2022-01-24 18:17:39 +01:00
response [Alerting] Forking LoTex ruler (#32138) 2021-03-19 10:32:13 -04:00
routing FeatureFlags: Revert managing feature flags outside of settings.Cfg (#44382) 2022-01-24 16:08:05 +01:00
static Chore: replace macaron with web package (#40136) 2021-10-11 14:30:59 +02:00
acl.go Chore: Propagate context for dashboard guardian (#39201) 2021-09-23 17:43:32 +02:00
admin_provisioning_test.go Chore: Add context to org (#40685) 2021-11-03 11:31:56 +01:00
admin_provisioning.go Chore: Remove Dispatch and AddHandler (#42603) 2021-12-02 18:08:59 +01:00
admin_test.go Access Control: Add fine-grained access control to GET stats and settings handlers (#35622) 2021-06-14 17:36:48 +02:00
admin_users_test.go Rename AddHandlerCtx to AddHandler (#43557) 2021-12-28 16:08:07 +01:00
admin_users.go Remove Macaron ParamsInt64 function from code base (#43810) 2022-01-15 00:55:57 +08:00
admin.go Rename DispatchCtx to Dispatch (#43563) 2021-12-28 17:36:22 +01:00
alerting_test.go Rename AddHandlerCtx to AddHandler (#43557) 2021-12-28 16:08:07 +01:00
alerting.go Remove Macaron ParamsInt64 function from code base (#43810) 2022-01-15 00:55:57 +08:00
annotations_test.go Rename AddHandlerCtx to AddHandler (#43557) 2021-12-28 16:08:07 +01:00
annotations.go Remove Macaron ParamsInt64 function from code base (#43810) 2022-01-15 00:55:57 +08:00
api.go AccessControl: Implement teams resource service (#43951) 2022-01-26 14:48:41 +00:00
apikey.go FeatureFlags: Revert managing feature flags outside of settings.Cfg (#44382) 2022-01-24 16:08:05 +01:00
app_routes.go Chore: Remove context.TODO (#43458) 2021-12-28 10:26:18 +01:00
basic_auth_test.go Macaron: remove custom Request type (#37874) 2021-09-01 11:18:30 +02:00
basic_auth.go Macaron: remove custom Request type (#37874) 2021-09-01 11:18:30 +02:00
common_test.go AccessControl: Implement teams resource service (#43951) 2022-01-26 14:48:41 +00:00
dashboard_permission_test.go Remove Macaron ParamsInt64 function from code base (#43810) 2022-01-15 00:55:57 +08:00
dashboard_permission.go Remove Macaron ParamsInt64 function from code base (#43810) 2022-01-15 00:55:57 +08:00
dashboard_snapshot_test.go Rename AddHandlerCtx to AddHandler (#43557) 2021-12-28 16:08:07 +01:00
dashboard_snapshot.go Rename DispatchCtx to Dispatch (#43563) 2021-12-28 17:36:22 +01:00
dashboard_test.go FeatureFlags: Revert managing feature flags outside of settings.Cfg (#44382) 2022-01-24 16:08:05 +01:00
dashboard.go Remove Macaron ParamsInt64 function from code base (#43810) 2022-01-15 00:55:57 +08:00
dataproxy.go Data Source Proxy: Migrate proxy to its own service and make more extensible (#31927) 2021-03-17 13:10:40 -04:00
datasources_test.go Datasource API: #32556 resolve readonly datasources can be modified (#44186) 2022-01-21 14:22:43 -09:00
datasources.go Datasource API: #32556 resolve readonly datasources can be modified (#44186) 2022-01-21 14:22:43 -09:00
fakes.go Plugins: Plugin Store API returns DTO model (#41340) 2021-11-17 12:04:22 +01:00
folder_permission_test.go Chore: Refactor api handlers to use web.Bind (#42199) 2021-11-29 10:18:01 +01:00
folder_permission.go Chore: Refactor api handlers to use web.Bind (#42199) 2021-11-29 10:18:01 +01:00
folder_test.go Chore: Refactor api handlers to use web.Bind (#42199) 2021-11-29 10:18:01 +01:00
folder.go Remove Macaron ParamsInt64 function from code base (#43810) 2022-01-15 00:55:57 +08:00
frontend_logging_test.go Logger migration from log15 to gokit/log (#41636) 2022-01-06 22:28:05 +08:00
frontend_logging.go Logger migration from log15 to gokit/log (#41636) 2022-01-06 22:28:05 +08:00
frontend_metrics.go Chore: Report frontend metrics for JS/CSS load time (#42421) 2021-12-02 09:34:39 +01:00
frontendsettings_test.go FeatureFlags: Revert managing feature flags outside of settings.Cfg (#44382) 2022-01-24 16:08:05 +01:00
frontendsettings.go FeatureFlags: Revert managing feature flags outside of settings.Cfg (#44382) 2022-01-24 16:08:05 +01:00
grafana_com_proxy.go Plugins Catalog: Install and show the latest compatible version of a plugin (#41003) 2021-11-12 11:07:12 +01:00
health_test.go Rename AddHandlerCtx to AddHandler (#43557) 2021-12-28 16:08:07 +01:00
health.go Rename DispatchCtx to Dispatch (#43563) 2021-12-28 17:36:22 +01:00
http_server_test.go Tests: Batch of GoConvey to Testify conversions (#27008) 2020-08-14 14:43:25 +02:00
http_server.go AccessControl: Implement teams resource service (#43951) 2022-01-26 14:48:41 +00:00
index.go FeatureFlags: Revert managing feature flags outside of settings.Cfg (#44382) 2022-01-24 16:08:05 +01:00
ldap_debug_test.go Remove Macaron ParamsInt64 function from code base (#43810) 2022-01-15 00:55:57 +08:00
ldap_debug.go Remove Macaron ParamsInt64 function from code base (#43810) 2022-01-15 00:55:57 +08:00
login_oauth_test.go Chore: Move remaining web framework code to pkg/web, remove macaron binding module (#43018) 2021-12-13 15:56:14 +01:00
login_oauth.go Rename DispatchCtx to Dispatch (#43563) 2021-12-28 17:36:22 +01:00
login_test.go Rename AddHandlerCtx to AddHandler (#43557) 2021-12-28 16:08:07 +01:00
login.go switch to using featureEnabled for enterprise features (#41559) 2022-01-07 15:11:23 -05:00
metrics.go Live: support query execution with live RPC (#43118) 2021-12-14 18:38:20 +01:00
org_invite.go Rename AddEventListenerCtx to AddEventListener and PublishCtx to Publish (#43566) 2022-01-04 09:36:01 +01:00
org_test.go AccessControl: Remove scopes from orgs endpoints (#41709) 2021-11-17 10:12:28 +01:00
org_users_test.go Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactionalDBSession in misc files (#43926) 2022-01-25 20:30:08 +01:00
org_users.go Remove Macaron ParamsInt64 function from code base (#43810) 2022-01-15 00:55:57 +08:00
org.go Refactor: Change sqlstore.inTransaction to SQLStore.WithTransactionalDBSession in misc files (#43926) 2022-01-25 20:30:08 +01:00
password.go Rename DispatchCtx to Dispatch (#43563) 2021-12-28 17:36:22 +01:00
playlist_play.go Rename DispatchCtx to Dispatch (#43563) 2021-12-28 17:36:22 +01:00
playlist.go Remove Macaron ParamsInt64 function from code base (#43810) 2022-01-15 00:55:57 +08:00
plugins_test.go Security: Fix directory traversal issue (#42846) 2021-12-07 19:15:53 +02:00
plugins.go Rename DispatchCtx to Dispatch (#43563) 2021-12-28 17:36:22 +01:00
preferences_test.go AccessControl: Remove scopes from orgs endpoints (#41709) 2021-11-17 10:12:28 +01:00
preferences.go Rename DispatchCtx to Dispatch (#43563) 2021-12-28 17:36:22 +01:00
quota_test.go AccessControl: Remove scopes from orgs endpoints (#41709) 2021-11-17 10:12:28 +01:00
quota.go Remove Macaron ParamsInt64 function from code base (#43810) 2022-01-15 00:55:57 +08:00
render.go Rendering: Add light theme for errors (#41616) 2021-11-17 12:18:47 +01:00
roles.go AccessControl: Implement teams resource service (#43951) 2022-01-26 14:48:41 +00:00
search.go Rename DispatchCtx to Dispatch (#43563) 2021-12-28 17:36:22 +01:00
short_url_test.go Chore: Refactor api handlers to use web.Bind (#42199) 2021-11-29 10:18:01 +01:00
short_url.go Chore: Refactor api handlers to use web.Bind (#42199) 2021-11-29 10:18:01 +01:00
signup.go Rename AddEventListenerCtx to AddEventListener and PublishCtx to Publish (#43566) 2022-01-04 09:36:01 +01:00
stars.go Chore: Remove bus from team (#44218) 2022-01-24 11:52:35 +01:00
team_members_test.go AccessControl: Implement teams resource service (#43951) 2022-01-26 14:48:41 +00:00
team_members.go AccessControl: Implement teams resource service (#43951) 2022-01-26 14:48:41 +00:00
team_test.go AccessControl: Implement teams resource service (#43951) 2022-01-26 14:48:41 +00:00
team.go AccessControl: Implement teams resource service (#43951) 2022-01-26 14:48:41 +00:00
user_test.go Remove Macaron ParamsInt64 function from code base (#43810) 2022-01-15 00:55:57 +08:00
user_token_test.go Rename AddHandlerCtx to AddHandler (#43557) 2021-12-28 16:08:07 +01:00
user_token.go Rename DispatchCtx to Dispatch (#43563) 2021-12-28 17:36:22 +01:00
user.go Remove Macaron ParamsInt64 function from code base (#43810) 2022-01-15 00:55:57 +08:00
utils.go Permissions: Validate against Team/User permission role update (#29101) 2020-11-18 15:36:41 +01:00