grafana/pkg/services
Gabriel MABILLE 88c11f1cc0
AccessControl: Implement a way to register fixed roles (#35641)
* AccessControl: Implement a way to register fixed roles

* Add context to register func

* Use FixedRoleGrantsMap instead of FixedRoleGrants

* Removed FixedRoles map to sync.map


* Wrote test for accesscontrol and provisioning

* Use mutexes+map instead of sync maps

* Create a sync map struct out of a Map and a Mutex

* Create a sync map struct for grants as well

* Validate builtin roles

* Make validation public to access control

* Handle errors consistently with what seeder does

* Keep errors consistant amongst accesscontrol impl

* Handle registration error

* Reverse the registration direction thanks to a RoleRegistrant interface

* Removed sync map in favor for simple maps since registration now happens during init

* Work on the Registrant interface

* Remove the Register Role from the interface to have services returning their registrations instead

* Adding context to RegisterRegistrantsRoles and update descriptions

* little bit of cosmetics

* Making sure provisioning is ran after role registration

* test for role registration

* Change the accesscontrol interface to use a variadic

* check if accesscontrol is enabled

* Add a new test for RegisterFixedRoles and fix assign which was buggy

* Moved RegistrationList def to roles.go

* Change provisioning role's description

* Better comment on RegisterFixedRoles

* Correct comment on ValidateFixedRole

* Simplify helper func to removeRoleHelper

* Add log to saveFixedRole and assignFixedRole

Co-authored-by: Vardan Torosyan <vardants@gmail.com>
Co-authored-by: Jeremy Price <Jeremy.price@grafana.com>
2021-07-30 09:52:09 +02:00
..
accesscontrol AccessControl: Implement a way to register fixed roles (#35641) 2021-07-30 09:52:09 +02:00
alerting Email: Allow configuration of content types for email notifications (#34530) 2021-07-19 13:31:51 +03:00
annotations Chore: Replace util.DynMap with structs (#36332) 2021-07-01 10:23:33 +02:00
auth Instrumentation: Start tracing database requests (#34572) 2021-05-27 13:55:33 +02:00
cleanup Chore: Refactor short url api test (#35051) 2021-06-01 20:34:59 +02:00
contexthandler add FromContext API for macaron and reqcontext, add API for standard middleware in macaron (#37057) 2021-07-26 06:11:43 +02:00
dashboards Folder API: optionally force deleting Grafana 8 alerts when deleting a folder (or error) (#36427) 2021-07-22 12:27:13 +03:00
datasourceproxy Chore: Refactor OAuth/social package to service (#35403) 2021-07-07 08:54:17 +02:00
datasources API: Add by UID routes for data sources (#29884) 2021-01-13 13:16:27 -05:00
guardian Permissions: Fix inherited folder permissions can prevent new permissions being added to a dashboard (#33329) 2021-04-28 14:42:18 +02:00
hooks API: replace SendLoginLogCommand with LoginHook (#28777) 2020-11-06 10:01:13 +01:00
ldap IPv6: Support host address configured with enclosing square brackets (#31226) 2021-02-15 17:55:41 +01:00
libraryelements Chore: Replace util.DynMap with structs (#36332) 2021-07-01 10:23:33 +02:00
librarypanels LibraryPanels: Fixes error when importing plugin dashboard (#34557) 2021-05-24 09:31:34 +02:00
licensing CDN: Adds support for serving assets over a CDN (#30691) 2021-02-01 10:13:09 +01:00
live live: various code cleanups (#37165) 2021-07-23 19:47:08 +03:00
login Auth: refactor to not use the global bus (#37345) 2021-07-29 11:47:32 +02:00
multildap Chore: Enable errorlint linter (#29227) 2020-11-19 14:47:17 +01:00
ngalert NGAlert: Send resolve signal to alertmanager on alerting -> Normal (#37363) 2021-07-29 20:29:17 +02:00
notifications Email: Allow configuration of content types for email notifications (#34530) 2021-07-19 13:31:51 +03:00
oauthtoken Chore: Refactor OAuth/social package to service (#35403) 2021-07-07 08:54:17 +02:00
provisioning AccessControl: Implement a way to register fixed roles (#35641) 2021-07-30 09:52:09 +02:00
quota Quota: Do not count folders towards dashboard quota (#32519) 2021-05-12 23:44:46 +02:00
rendering Renderer: add version information (#34964) 2021-06-04 14:33:49 +03:00
schemaloader [Dashboard] Revert feature toggle trimdefaults (#34888) 2021-05-28 22:29:30 +02:00
search bus: add ctx for all signed in user queries (#33970) 2021-05-18 18:24:42 +02:00
shorturls Chore: Refactor short url api test (#35051) 2021-06-01 20:34:59 +02:00
sqlstore Alerting: Deduplicate receivers during migration (#36812) 2021-07-29 15:56:19 +02:00
teamguardian chore: avoid aliasing imports in services (#22499) 2020-02-29 13:35:15 +01:00
validations Plugins: Requests validator (#30445) 2021-02-03 20:47:45 +01:00