82 Commits

Author SHA1 Message Date
54de1078c8 remove the global log error/warn etc functions (#41404)
* remove the global log error/warn etc functions and use request context logger whenever possible
2021-11-08 17:56:56 +01:00
681218275e remove crit and trace (#40320) 2021-10-26 17:36:24 +02:00
a9faab6b09 Dashboard: Add week start option to global and dashboard preferences (#40010)
* Add global week start option to shared preferences

* Add default_week_start to configuration docs

* Add week start option to dashboards

* Add week start argument to tsdb time range parser

* Fix strict check issues

* Add tests for week start

* Change wording on default_week_start documentation

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

* Update week_start column to be a nullable field

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>

* Update configuration to include browser option

* Update WeekStartPicker container selector

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>

* Add menuShouldPortal to WeekStartPicker to remove deprecation warning

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

* Add inputId to WeekStartPicker

* Use e2e selector on WeekStartPicker aria-label

* Simplify WeekStartPicker onChange condition

* Specify value type on WeekStartPicker weekStarts

* Remove setWeekStart side effect from reducer

* Fix updateLocale failing to reset week start

* Store week start as string to handle empty values

Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
2021-10-18 10:27:14 -03:00
a7e721e987 Access control: Make Admin/Users UI working with the permissions (#33176)
* API: authorize admin/users views

* Render admin/users components based on user's permissions

* Add LDAP permissions (required by admin/user page)

* Extend default admin role by LDAP permissions

* Show/hide LDAP debug views

* Render LDAP debug page if user has access

* Authorize LDAP debug view

* fix permissions definitions

* Add LDAP page permissions

* remove ambiguous permissions check

* Hide logout buttons in sessions table

* Add org/users permissions

* Use org permissions for managing user roles in orgs

* Apply permissions to org/users

* Apply suggestions from review

* Fix tests

* remove scopes from the frontend

* Tweaks according to review

* Handle /invites endpoints
2021-04-22 13:19:41 +03:00
8b843eb0a6 Access control: expose permissions to the frontend (#32954)
* Expose user permissions to the frontend

* Do not include empty scope

* Extend ContextSrv with hasPermission() method

* Add access control types

* Fix type error (make permissions optional)

* Fallback if access control disabled

* Move UserPermission to types

* Simplify hasPermission()
2021-04-16 16:02:16 +03:00
7f1f559929 Permissions: Fix team and role permissions on folders/dashboards not displayed for non Grafana Admin users (#31132)
* Cfg: fix hidden users initialization

* add tests

* do not call isHiddenUser function for non-user permission

* do not call isHiddenUser function for non-user permission
2021-02-12 16:08:18 +01:00
22788d1d86 Add an option to hide certain users in the UI (#28942)
* Add an option to hide certain users in the UI

* revert changes for admin users routes

* fix sqlstore function name

* Improve slice management

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>

* Hidden users: convert slice to map

* filter with user logins instead of IDs

* put HiddenUsers in Cfg struct

* hide hidden users from dashboards/folders permissions list

* Update conf/defaults.ini

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>

* fix params order

* fix tests

* fix dashboard/folder update with hidden user

* add team tests

* add dashboard and folder permissions tests

* fixes after merge

* fix tests

* API: add test for org users endpoints

* update hidden users management for dashboard / folder permissions

* improve dashboard / folder permissions tests

* fixes after merge

* Guardian: add hidden acl tests

* API: add team members tests

* fix team sql syntax for postgres

* api tests update

* fix linter error

* fix tests errors after merge

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
Co-authored-by: Leonard Gram <leo@xlson.com>
2020-11-24 12:10:32 +01:00
4dd7b7a82d Chore: Remove unused Go code (#28852)
* Chore: Remove more unused Go code

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-11-17 11:51:31 +01:00
4c56eb3991 Chore: Enable goprintffuncname and nakedret linters (#26376)
* Chore: Enable goprintffuncname linter
* Chore: Enable nakedret linter

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-07-23 08:14:39 +02:00
d4e4cb4c71 Chore: Enable Go linter gocritic (#26224)
* Chore: Enable gocritic linter

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-07-16 14:39:01 +02:00
3fdd2648b1 Chore: Avoid aliasing importing models in api package (#22492) 2020-03-04 12:57:20 +01:00
0a2d5e16dd pkg/api: Check errors (#19657)
* pkg/api: Check errors
* pkg/api: Remove unused function HashEmail
2019-10-08 18:57:53 +02:00
5713048f48 Alerting: Improve alert rule testing (#16286)
* tsdb: add support for setting debug flag of tsdb query

* alerting: adds debug flag in eval context

Debug flag is set when testing an alert rule and this debug
flag is used to return more debug information in test aler rule
response. This debug flag is also provided to tsdb queries so
datasources can optionally add support for returning additional
debug data

* alerting: improve test alert rule ui

Adds buttons for expand/collapse json and copy json to clipboard,
very similar to how the query inspector works.

* elasticsearch: implement support for tsdb query debug flag

* elasticsearch: embedding client response in struct

* alerting: return proper query model when testing rule
2019-06-25 08:52:17 +02:00
9680a3d44d Gravatar fallback does not respect 'AppSubUrl'-setting (#12149)
Closes #12148
2018-06-04 16:03:59 +02:00
770acee56a new property for current user indicating if edit permissions in folders 2018-04-30 15:34:31 +02:00
9e2e6fc586 add fallback for gravatar in org/admin view
closes #11095
2018-03-27 22:52:29 +02:00
af34f9977e Add avatar to team and team members page (#10305)
* teams: add db migration for email column in teams table

* teams: /teams should render index page with a 200 OK

* teams: additional backend functionality for team and team members

Possibility to save/update email for teams.
Possibility to retrive avatar url when searching for teams.
Possibility to retrive avatar url when searching for team members.

* teams: display team avatar and team member avatars

Possibility to save and update email for a team

* teams: create team on separate page instead of modal dialog
2017-12-20 21:20:12 +01:00
9605ab4475 Merge branch 'master' into develop 2017-10-26 15:59:50 +02:00
89923bf77a datasources: change to optimisic concurrency
prerequisite for #9504
2017-10-23 07:55:16 +02:00
95f5c84a57 ux: making org visibile in profile view 2017-08-16 15:03:49 +02:00
c87418d060 refactoring: Dashboard history restore operation is now reusing existing
operations instead of duplicating a bunch of get & save logic.
2017-06-05 17:45:27 +02:00
aee4af2148 api: omit unused fields for /api/datasources
Fixes #7822
2017-04-25 15:23:36 +02:00
cbd1455c42 fix(api): case insensitive sort for datasources
The data source list is case sensitive when sorted. This changes the
sort to be case insensitive. The test only tests the handler, not the
routing or database query.
2017-02-07 22:15:52 +01:00
330c1b945e refactor(datasource): refactoring datasource secure json fields handling, #6697, #6692 2016-12-14 21:06:10 +01:00
dee6b7d150 Merge branch 'master' into getting-started-panel 2016-12-08 08:51:40 +01:00
7bc1c3cc1c feat(cloudwatch): make it possible to reset keys
closes #6697
2016-11-24 16:37:33 +01:00
2893b25a05 feat(datasources): allow updating of tls certs
The tls files are stored as a json blob in the
SecureJsonData field. To update one file, the
json has to be fetched from the db first and
then updated with the cert file that has been
changed.

Also, a change to the dto with flags that are
used in the frontend to show if a file has
been uploaded. For example, if tlsClientKeySet
is set to true then means a file for the
client key is saved in the db. This is to
avoid sending any private data to the frontend.
2016-11-24 13:22:25 +01:00
c9b2c694f1 refactor(dataproxy): TLS Client Auth
Use a SecureJsonData field for TLS
Client Auth instead of 3 new db
fields. Same model as used for
PluginSettings.

Saves and encrypts the pem file
content rather than just saving
the paths to the cert and key.
This allows for uploading from
the Edit Datasource page in
Grafana.
2016-11-24 13:22:25 +01:00
56b7e2dfaf Added support for TLS client auth for datasource proxies (#5801) 2016-11-24 13:22:25 +01:00
fb57bf77da ux(getting started): progress on getting started panel and persited help flag states, #6466 2016-11-09 10:41:39 +01:00
3ecd96e682 feat(testdata): lots of work on new test data data source and scenarios 2016-09-27 18:17:39 +02:00
34f15d92d0 feat(testdata): worked on testdata app 2016-09-27 14:39:51 +02:00
5595fc2683 refactor(): refactored date handling and locale handling in #5517 2016-07-05 17:59:43 +02:00
ab1048b7ee feat(preferences): theme and home dashbord settings now work work on profile and org settings page 2016-04-02 13:54:06 -07:00
7023dedc05 feat(preferences): refactoring PR #4399 2016-03-20 11:52:19 +01:00
9e98c86ae1 Merge branch 'master' into preferences 2016-03-20 11:27:49 +01:00
66621d762e Added getDashboardSlugById api 2016-03-17 01:01:58 -07:00
e4c0c39fbf ux(): began work on updating data source list to cards view 2016-03-15 20:29:35 +01:00
0398face05 feat(plugins): dashboard import for data sources is working! #4298 2016-03-12 10:13:49 +01:00
1f9f439acb lib(): added simplejson lib 2016-03-11 23:28:33 +01:00
4fbff99186 Implemented GetDataSourceIdByName API 2016-03-10 01:31:10 -08:00
08f7ccff38 feat(avatar): added server side proxy and cache of gravatar requests 2016-02-21 00:06:28 +01:00
00a6efa15e Excluded total calculations from backend 2016-02-01 23:26:11 -08:00
972ac99b7c Added more metadata 2016-01-28 09:53:19 -08:00
b30dcce4bc Added dtos and UI for more metadata 2016-01-28 00:52:52 -08:00
58121d89fc Updated http_api docs 2016-01-27 22:02:33 -08:00
753fd164d7 Added createdBy in metadata ui and dashboard table 2016-01-27 17:11:21 -08:00
38ddc88b20 fix(api): do not include null jsonData field in /api/datasources resource, closes #3755 2016-01-15 15:57:00 +01:00
cb5c1bd24d Removed created_by and fixed gofmt 2015-12-18 02:30:20 -08:00
e0ffcda32e Added UI , DB settings 2015-12-18 00:20:23 -08:00