Commit Graph

308 Commits

Author SHA1 Message Date
Sofia Papagiannaki
6bb843bd0e
API: Introduce health and resources data source endpoints using the data source UID (#48676)
* API: introduce health and resources datasource endpoints with UID

* Document endpoints

* Update swagger
2022-05-19 19:27:59 +03:00
Kat Yang
719af24235
Refactor: Add UID endpoint for dashboard versions and restore (#48364)
* Refactor: Add UID endpoint for dashboard versions and restore

* Fix: User dashID instead of dash.id

* 💩

* Move apiCmd error handling outside of dashUID check

* fix the panic in test

* Fix handler and update docs

Co-authored-by: Kat Yang <yangkb09@users.noreply.github.com>

* Docs: add deprecated warning to restore and version docs

* Fix hyperlink text

* Add swagger endpoints for restore and versions

* Add deprecated tag on swagger for both endpoints

* Fix: Update access control to be dashboards

* Return UID in response; Update docs to reflect this; Implement Ying suggestion

* Update docs/sources/http_api/dashboard_versions.md

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* Update pkg/models/dashboard_version.go

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* Update pkg/models/dashboard_version.go

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* Update query to refer to DashboardUID

Co-authored-by: Ying WANG <ying.wang@grafana.com>
Co-authored-by: Sofia Papagiannaki <sofia@grafana.com>
Co-authored-by: Kat Yang <yangkb09@users.noreply.github.com>
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2022-05-17 12:57:27 -04:00
Jack Baldry
51dfcd7d37
Add current alias to all files (#48635)
* Add aliases to all files

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>

* Prettify front matter

Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
2022-05-17 08:24:11 -07:00
Gabriel MABILLE
83e234d4f6
AccessControl: Document basic roles changes and provisioning V2 (#48910)
* AccessControl: Document basic roles simplifying

* Add sample file for provisioning v2

* WIP

* Update provisioning example from docs

* Fix wrong permission in docs

* Nits on about-rbas.md

* Manage rbac roles

* Nit.

* Nit.

* Rephrase

* Comment

* Add version to the role

* Update role

* Update role

* Spell

* Final touch on about-rbac

* Add basic role UID mapping about-rbac

* Team assignments

* assign rbac roles

* move for more info

* enable rbac and provisioning

* spell

* plan rbac rollout strategy

* Cover factory reset

* remove builtin assignment permissions from docs

* to -> from

* Custom role actions scopes

* spell

* Update docs/sources/enterprise/access-control/about-rbac.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/about-rbac.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/assign-rbac-roles.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/assign-rbac-roles.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/assign-rbac-roles.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/plan-rbac-rollout-strategy.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/plan-rbac-rollout-strategy.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/manage-rbac-roles.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/custom-role-actions-scopes.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/custom-role-actions-scopes.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/enable-rbac-and-provisioning.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/manage-rbac-roles.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/manage-rbac-roles.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/manage-rbac-roles.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/manage-rbac-roles.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/manage-rbac-roles.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/manage-rbac-roles.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/manage-rbac-roles.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/manage-rbac-roles.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/manage-rbac-roles.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/manage-rbac-roles.md

* Update docs/sources/enterprise/access-control/manage-rbac-roles.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Remove factory as much as possible

* Update docs/sources/enterprise/access-control/plan-rbac-rollout-strategy.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/plan-rbac-rollout-strategy.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Have -> Must

 Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Have -> Must

 Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Replace factory by hard reset

* Replace LINK

* Update docs/sources/enterprise/access-control/about-rbac.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Suggestion on example descriptions

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/manage-rbac-roles.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Remove comment on permissions escalate

* Prettier.

* add a sentence to explain the type:escalate

* add a sentence to explain the type:escalate

* Rephrase

* Remove TODOs as discussed with jguer

Co-authored-by: Jguer <joao.guerreiro@grafana.com>

* Implement vardan's suggestion to have only one mapping:

Co-authored-by: Vardan Torosyan <vardants@gmail.com>

* Document that you cannot delete basic roles

Co-authored-by: Vardan Torosyan <vardants@gmail.com>

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Jguer <joao.guerreiro@grafana.com>
Co-authored-by: Vardan Torosyan <vardants@gmail.com>
2022-05-17 15:46:43 +02:00
Kat Yang
9a0f2ec449
Refactor: Add UID endpoint for get dashboard version (#48600)
* Refactor: Add UID endpoint for get dashboard version

* Add initial docs language

* Add new endpoint in swagger

* Change access control to dashboards

* Add parameters to swagger endpoint

* Return UID in response; Update docs to reflect this; Implement Ying suggestion

* Update docs/sources/http_api/dashboard_versions.md

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* Update pkg/api/api.go

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* Update pkg/models/dashboard_version.go

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* Rename UID to DashboardUID for clarity; use dashUID in method

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2022-05-17 12:59:02 +02:00
Gabriel MABILLE
d31d300ce1
Accesscontrol: Rename scope permissions:delegate (#48898) 2022-05-11 17:22:43 +02:00
ying-jeanne
0d14c27eb9
Chore: add Folderuid into panel-library API (#48577)
* add folderuid into interface

* panellibrary id/uid things

* modify doc

* update doc

* correct some comments
2022-05-05 10:04:54 +02:00
achatterjee-grafana
082cfbdb06
Docs: Refactor alerting documentation (part 1) (#48664)
* Initial commit

* Moved files, ad fixed broken relrefs.

* Fixed other broken relrefs

* More changes.

* Fixing broken relrefs

* More changes.

* Fixed last of the broken links

* More re-org.

* Added aliases and some weight adjustments

* More aliases.

* Fix fundamentals topic.

* Fixed remaining metadata issues

* Ran prettier
2022-05-04 08:22:11 -04:00
Will Browne
4ecd57f49c
Plugins: Introduce HTTP 207 Multi Status response to api/ds/query (#48550)
* feature toggles

* return HTTP 207 from ds/query

* add ft check

* add API test

* add 207 check for qr

* change to OR

* revert check

* add explicit toggle check for cloudwatch

* remove unused import

* remove from defaults.ini

* add status codes to md and update swagger

* new fangled http api tests pattern

* update swagger

* Update docs/sources/http_api/data_source.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* add missing word and reformat

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
2022-05-03 18:02:20 +02:00
Andreas Gerstmayr
21034e31de
chore: remove executable permissions of source files and docs (#46303) 2022-05-03 12:08:14 +02:00
ying-jeanne
bde368be55
Chore : Replace dashboardid with dashboardUID in annotation API (#48481)
* replace dashboardid with dashboardUID in annotation API

* add some tests

* modify some docs and add uid into get endpoint

* rebase with main

* add map for avoiding too much retrieve on dashboards
2022-05-02 11:35:36 +02:00
ying-jeanne
1667a7c0da
Chore: Modify patch and update of preference to take homedashboarduid than h… (#48281)
* modify patch and update of preference to take homedashboarduid than homedashboardid

* to be tested

* use getdashboard

* update doc
2022-04-29 14:37:33 +02:00
Ivana Huckova
b92fe0e0f5
Query history: Add from and to parameters (#48212)
* Query history: Add from and to parameters

* Update docs/sources/http_api/query_history.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/query_history.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/query_history.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Implement Grafana relative time range

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2022-04-29 09:55:33 +02:00
Christopher Moyer
a20b3e2d59
Docs: Fine-grained access control refactor (#47536)
* fleshing out About topic

* docs, fgac refactor initial draft

* updated FGAC with service account details

* finalized restructure

* make prettier, corrects spelling

* fixes typo

* adds rollout strategy topic

* started name change

* renamed to rbac throughout docs

* copy edit to about and actions and scopes docs

* finishes content reorg

* draft of refactored refactored docs

* corrects relrefs

* formatting tweaks

* fixes typo

* copy updates to about rbac

* rbac rollout docs edits

* update rbac role assignment docs

* content update to manage rbac roles doc

* sort and reorder roles reference in rbac docs

* alphabetize permissions table

* Update docs/sources/enterprise/settings-updates.md

Co-authored-by: Mitch Seaman <mjseaman@users.noreply.github.com>

* incorporates feedback, makes prettier

* update http api references in rbac docs

* fix broken refs and improve wording on enabling RBAC provisioning

Co-authored-by: eleijonmarck <eric.leijonmarck@gmail.com>
Co-authored-by: Mitchel Seaman <mitchel.seaman@gmail.com>
Co-authored-by: Mitch Seaman <mjseaman@users.noreply.github.com>
2022-04-27 09:51:56 -05:00
idafurjes
d99d095ac6
Add endpoint with UID for dashboard permissions (#47753)
* Replace sequential IDs with UID for dashboard permossion

* Add back endpoint with id

* Rename parameter from dashboarUid->uid and add swagger definitions for endpoints

* Generate swagger json

* Add deprecated to swagger and docs

* Add deprecated comment in the api.go

* Add model for POST body

* Fix model post body for endpoint

* Generate spec with enterprise
2022-04-21 16:24:03 +02:00
Eric Leijonmarck
7be8fe027f
Add docs for service accounts 8.5 (#46801)
* initial doc for service accounts

* service account token calls complete

* service account tasks

* Update docs/sources/http_api/serviceaccount.md

* adding a token to the service account

* removed unused file

* refactor: review comments

* feat: add API key documentation

* fix: spelling

* Update docs/sources/administration/service-accounts/about-service-accounts.md

Co-authored-by: Jguer <joao.guerreiro@grafana.com>

* Update docs/sources/administration/service-accounts/about-service-accounts.md

Co-authored-by: Jguer <joao.guerreiro@grafana.com>

* Update docs/sources/http_api/serviceaccount.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/administration/service-accounts/enable-service-accounts.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/administration/service-accounts/enable-service-accounts.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/administration/service-accounts/enable-service-accounts.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/administration/service-accounts/enable-service-accounts.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/administration/service-accounts/enable-service-accounts.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/administration/api-keys/about-api-keys.md

* refactor: based on review

* removed the permissions for apikeys, as they are not necessary

* Apply suggestions from code review

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Update docs/sources/administration/service-accounts/create-service-account.md

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>

* update based on review

* Fix formatting of bullet points

* formatting

* refcator

Co-authored-by: Jguer <joao.guerreiro@grafana.com>
Co-authored-by: Christopher Moyer <35463610+chri2547@users.noreply.github.com>
Co-authored-by: Vardan Torosyan <vardants@gmail.com>
2022-04-11 15:45:02 +01:00
Ieva
ef4c2672b3
Access control: SQL filtering for annotation listing (#47467)
* pass in user to attribute scope resolver

* add SQL filter to annotation listing

* check annotation FGAC permissions before exposing them for commenting

* remove the requirement to be able to list all annotations from annotation listing endpoint

* adding tests for annotation listing

* remove changes that got moved to a different PR

* unused var

* Update pkg/services/sqlstore/annotation.go

Co-authored-by: Ezequiel Victorero <evictorero@gmail.com>

* remove unneeded check

* remove unneeded check

* undo accidental change

* undo accidental change

* doc update

* move tests

* redo the approach for passing the user in for scope resolution

* accidental change

* cleanup

* error handling

Co-authored-by: Ezequiel Victorero <evictorero@gmail.com>
2022-04-11 13:18:38 +01:00
Ieva
bc9b5325a0
update docs, simplify actions and scopes (#47067) 2022-04-04 13:53:58 +01:00
Will Browne
572ca553b6
Plugins: Add deprecation notice for /api/tsdb/query endpoint (#45238)
* add deprecation notice for /api/tsdb/query

* fix linking

* regenerate after gen-go

* add newline

* add API docs for ds/query

* regenerate spec

* pr feedback

* add helpful tip

* make sub heading

* add more data

* update spec

* update wording

* mention both from/to

* add suggestions

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* docs feedback

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2022-03-30 17:46:06 +02:00
Karl Persson
faf4a3f751
Access Control: Rename global users scope (#46794)
* Rename scope from global:users to global.users to match scope convention
2022-03-22 12:48:46 +01:00
Ashley Harrison
586272e5f0
Navigation: Introduce a preferences table to store Navbar preferences (#44914)
* First attempt at creating new navbar_preferences table in db

* Apply to every nav item instead of just home

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* Chore: introduce initTestDB options for features

* fix unit tests

* Add another unit test and some logic for detecting if a preference already exists

* tidy up

* Only override IsFeatureToggleEnabled if it's defined

* Extract setNavPreferences out into it's own function, initialise features correctly

* Make the linter happy

* Use new structure

* user essentials mob! 🔱

* user essentials mob! 🔱

* Split NavbarPreferences from Preferences

* user essentials mob! 🔱

* user essentials mob! 🔱

* Fix lint error

* Start adding tests

* Change internal db structure to be a generic json object

* GetJsonData -> GetPreferencesJsonData

* Stop using simplejson + add some more unit tests

* Update pkg/api/preferences.go

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Updates following review comments

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* Change patch to upsert, add a unit test

* remove commented out code

* introduce patch user/org preferences methods

* Return Navbar preferences in the get call

* Fix integration test by instantiating JsonData

* Address review comments

* Rename HideFromNavbar -> Hide

* add swagger:model comment

* Add patch to the preferences documentation

* Add openapi annotations

* Add a short description

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* user essentials mob! 🔱

* Update unit tests

* remove unneeded url

* remove outdated comment

* Update integration tests

* update generated swagger

Co-authored-by: Alexandra Vargas <alexa1866@gmail.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2022-03-17 12:07:20 +00:00
Ieva
510c69ec91
Access control: allow hiding roles (#46358)
* allow hiding roles

* extend docs

* docs feedback

* extend provisioning docs

* formatting

Co-authored-by: Leonard Gram <leo@xlson.com>
2022-03-15 13:17:45 +00:00
Ivana Huckova
6e96506c23
Query history: Add search functionality (#45932)
* Query history: Add search functionality

* Add more tests

* Add documentation

* Fix spell errors

* Update docs

* Update docs

* Fix lint error

* Update docs/sources/http_api/query_history.md

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>

* Document limit

* Run tests with postgres and mysql

* Use CASE insted of IIF

* Use BooleanStr instead of 1

* Change LIKE to LikeStr()

* Return back integration tests

* Update SQL to use Bool() everywhere

* Create new tests for sorting

* Update docs/sources/http_api/query_history.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/query_history.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/query_history.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/query_history.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/query_history.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Add page, count and limit to results

* Remove newline

* Update documentation

* Update docs

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2022-03-07 12:28:04 +01:00
Melori Arellano
8a98354844
Update dashboard_versions.md (#45871)
Fixes https://github.com/grafana/grafana/issues/45866, change dashboard version example to use `version` instead of `id`

`api/dashboards/id/24/versions/1`
2022-02-24 16:15:58 -05:00
Ivana Huckova
a3a852be81
Query history: Create API to star and unstar query in query history (#45077)
* Query history: Add starring and unstarring API

* Return dto with starred info when commenting

* Add documentation for starring and unstarring of query

* Return dto when starring/unstarring

* Update documentation

* Update deleting with unstarring

* Check queryUID length in queryhistory

* Fix linting issues

* Update docs/sources/http_api/query_history.md

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>

* Update docs/sources/http_api/query_history.md

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2022-02-23 17:03:04 +01:00
matt abrams
ade8c18557
add default number of returned dashboards (#45755) 2022-02-23 04:28:39 -08:00
Ieva
11433cba97
Team access changes for editors when editorsCanAdmin is enabled (#45405)
* filter teams for editors to only show the teams that they are members of

* frontend changes to only allow clicking on teams that the user can edit

* update frontend test snapshots

* extend docs

* reword

* remove the comment for now

* Update backend tests

* reword the warning, and add it back in

* docs feedback

Co-authored-by: gamab <gabi.mabs@gmail.com>
2022-02-15 17:09:03 +00:00
Ivana Huckova
636a45f065
Query history: Create API to patch comment of query in query history (#44981)
* Query history: Patch comment

* Update docs/sources/http_api/query_history.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/query_history.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Remove redundant check

* Use WithTransactionalDbSession to update comment

* Fix status code in test

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2022-02-15 15:43:17 +01:00
Ieva
9ac4843df1
Documentation for teams with FGAC (#45321)
* docs for teams with FGAC

* Update docs/sources/enterprise/access-control/fine-grained-access-control-references.md

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

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2022-02-11 18:00:13 +01:00
Roberto Acevedo
1239911b5b
Update access_controls.md: Add global to documented query parameter for deleting custom roles. (#40167)
* Update access_controls.md

Update the parameter table for deleting custom roles to make it explicit that the `global` query parameter is handled by this endpoint/should be specified when deleting a globally-scoped role.

* Update docs/sources/http_api/access_control.md

Co-authored-by: Karl Persson <kalle.persson92@gmail.com>
Co-authored-by: achatterjee-grafana <aparajita.chatterjee@grafana.com>
2022-02-10 18:27:39 -05:00
Dimitris Sotirakis
605d056136
Security: Sync security changes on main (#45083)
* * Teams: Appropriately apply user id filter in /api/teams/:id and /api/teams/search
* Teams: Ensure that users searching for teams are only able see teams they have access to
* Teams: Require teamGuardian admin privileges to list team members
* Teams: Prevent org viewers from administering teams
* Teams: Add org_id condition to team count query
* Teams: clarify permission requirements in teams api docs
* Teams: expand scenarios for team search tests
* Teams: mock teamGuardian in tests

Co-authored-by: Dan Cech <dcech@grafana.com>

* remove duplicate WHERE statement

* Fix for CVE-2022-21702

(cherry picked from commit 202d7c190082c094bc1dc13f7fe9464746c37f9e)

* Lint and test fixes

(cherry picked from commit 3e6b67d5504abf4a1d7b8d621f04d062c048e981)

* check content type properly

(cherry picked from commit 70b4458892bf2f776302720c10d24c9ff34edd98)

* basic csrf origin check

(cherry picked from commit 3adaa5ff39832364f6390881fb5b42ad47df92e1)

* compare origin to host

(cherry picked from commit 5443892699e8ed42836bb2b9a44744ff3e970f42)

* simplify url parsing

(cherry picked from commit b2ffbc9513fed75468628370a48b929d30af2b1d)

* check csrf for GET requests, only compare origin

(cherry picked from commit 8b81dc12d8f8a1f07852809c5b4d44f0f0b1d709)

* parse content type properly

(cherry picked from commit 16f76f4902e6f2188bea9606c68b551af186bdc0)

* mentioned get in the comment

(cherry picked from commit a7e61811ef8ae558ce721e2e3fed04ce7a5a5345)

* add content-type: application/json to test HTTP requests

* fix pluginproxy test

* Fix linter when comparing errors

Co-authored-by: Kevin Minehart <kmineh0151@gmail.com>
Co-authored-by: Dan Cech <dcech@grafana.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>
Co-authored-by: Vardan Torosyan <vardants@gmail.com>
2022-02-09 13:44:38 +01:00
Ivana Huckova
0f362f8dfc
Query history: Create API to delete query from query history (#44653)
* Query history: Add delete and refactor

* Update docs/sources/http_api/query_history.md

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2022-02-04 16:14:36 +01:00
Vardan Torosyan
b38d3f339a
Documentation for granting and revoking access for teams. (#44863) 2022-02-04 13:17:25 +01:00
JM
16f0c6617a
Update docs library element http api (#44493) 2022-02-03 08:46:03 +01:00
Julien Pivotto
b78082f426
doc: snapshots: fix JSON response (#44758) 2022-02-02 14:03:14 +01:00
JM
925333bfa4
Library Elements API GET by name returns array (#44743)
* Library Elements API GET by name returns array

Making a GET request to the Library Elements HTTP API `api/library-elements/name/:name` will return an **array** of Library Element objects, but the documentation says it will return a Library Element object.

Example cURL POST request:
`curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer XXXXXXXXXXX" -d @request.json "https://my.grafana.net/api/library-elements/"`

request.json
```json
{
  "model": {},
  "kind": 1,
  "name": "testing description3",
  "uid": "basic3",
  "id": 12345,
  "version": 2
}
```

Example cURL GET request:
`curl -X GET -H "Content-Type: application/json" -H "Authorization: Bearer XXXXXXXX" -d @request "https://my/api/library-elements/name/testing description3"`

Example response:
```json
{
    "result": [
        {
            . . .
        }
    ]
}
```

* Library Elements API fix bracket spacing
2022-02-02 09:50:27 +01:00
Vardan Torosyan
2053049c40
Remove service accounts from public documentation as it's not being released yet (#44658) 2022-01-31 16:37:51 +01:00
Ivana Huckova
4e37a53a1c
Query history: Create API to add query to query history (#44479)
* Create config to enable/disable query history

* Create add to query history functionality

* Add documentation

* Add test

* Refactor

* Add test

* Fix built errors and linting errors

* Refactor

* Remove old tests

* Refactor, adjust based on feedback, add new test

* Update default value
2022-01-28 17:55:09 +01:00
J Guerreiro
84c89ec61e
Docs: Add usage stats preview to doc (#43995)
* Docs: Add usage stats preview to doc

* Fix: remove permissions references
2022-01-24 14:24:58 +01:00
Tim Levett
641e34e341
Bug: Fixed User API Link (#44342)
Very minor fix to complete the User API link.
2022-01-23 06:33:50 +01:00
JM
8a21385481
Docs: add API pages to HTTP API list (#42997)
* add API pages to HTTP API list

* fix capitalization of page names
2022-01-21 10:19:11 -05:00
Karl Persson
8271bc73f9
Update docs for ds permissions access control permisisons (#43346) 2022-01-11 14:52:33 +01:00
Eric Leijonmarck
55ce03bd0c
Serviceaccounts: Add serviceaccount docs (#41712)
* Adds serviceaccount docs

* WIP

* wip

* Update docs/sources/manage-users/serviceaccount/serviceaccount.md

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* Update docs/sources/manage-users/serviceaccount/serviceaccount.md

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* Update docs/sources/http_api/serviceaccount.md

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* Update docs/sources/http_api/serviceaccount.md

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* Update docs/sources/http_api/serviceaccount.md

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* Update docs/sources/http_api/serviceaccount.md

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* updates

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
2021-12-01 10:16:56 +00:00
Eric Leijonmarck
d997e051c2
AccessControl: Document role display name (#40068)
* docs: role displayname

* Update docs/sources/enterprise/access-control/roles.md

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* Update docs/sources/enterprise/access-control/roles.md

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* refactor: update accesscontrol based on fixed roles

* update displayname text

* Update docs/sources/enterprise/access-control/roles.md

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>

* updated group

Co-authored-by: Ursula Kallio <73951760+osg-grafana@users.noreply.github.com>
Co-authored-by: eleijonmarck <eleijonmarck@Erics-MBP.home>
2021-11-29 15:06:10 +01:00
Mitch Seaman
5043448769
[Docs] Document FGAC user role assignment (#41797) 2021-11-24 22:50:48 +01:00
Gabriel MABILLE
a93e649af5
AccessControl: Document orgs roles and orgs endpoints (#42171)
* AccessControl: Document `orgs` roles and `orgs` endpoints

* Use maintainer instead of manager
2021-11-24 10:08:55 +01:00
Agnès Toulet
3a6b8535b1
API: return resource ID when deleting datasource with UID and library element (#41342)
* API: return resource ID when deleting datasource and library element

* keep status codes consistent

* fix element ID

* add test

* improve response struct

* update endpoints documentation

* LibraryElementIDResponse -> DeleteLibraryElementResponse
2021-11-05 15:06:14 +01:00
Ursula Kallio
ff8f98170c
Use sentence case for consistency: (#40285)
For example, https://grafana.com/docs/grafana/next/http_api/access_control/ uses sentence case and the link text is inconsistent.
2021-10-28 19:26:23 +02:00
Felix
385bc1fe13
Update dashboard_versions.md (#38812)
getting a version by the id of the version doesn't work
you need to use the number of the version
2021-10-21 13:19:58 +02:00
Hugo Häggmark
d09cdfb844
Docs: Add documentation for library elements API (#39829)
* LibraryElements: Adds api documentation

* Update docs/sources/http_api/library_element.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/library_element.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/library_element.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/library_element.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/library_element.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/library_element.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/library_element.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/library_element.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/library_element.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/library_element.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/library_element.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/library_element.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/library_element.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/library_element.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/library_element.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/library_element.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/library_element.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/library_element.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/library_element.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/library_element.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/library_element.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/library_element.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Update docs/sources/http_api/library_element.md

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Refactor: changes after PR comments

* Apply suggestions from code review

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>

* Chore: updates after review

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-10-07 07:29:27 +02:00