Commit Graph

24 Commits

Author SHA1 Message Date
Émile Fugulin
d721dd13cd
Allow API to assign new user to a specific organization (#21775)
* Allow API to assign new user to a specific organization

* Add defer block to test

* Add API tests and return 400 instead of 500 for bad orgId

* Minor test improvements
2020-04-15 12:11:45 +03:00
Carl Bergquist
3798ac903d
Upgrade golangci-lint and fixes some linting errors. (#22909)
Example: https://play.golang.org/p/cfPIPG3BwjJ
2020-03-23 13:37:53 +01:00
Arve Knudsen
2a78d2a61c
pkg/services: Check errors (#19712)
* pkg/services: Check errors
* pkg/services: Don't treat context.Canceled|context.DeadlineExceeded as error
2019-10-22 14:08:18 +02:00
Oleg Gaidarenko
d9f01cb822
SQLStore: use bool pointer instead of string (#18111) 2019-07-17 06:24:56 +03:00
Oleg Gaidarenko
8e0f091f14
SQLStore: allow to look for is_disabled flag (#18032)
* Add support for `is_disabled` to `CreateUser()`

* Add support for `is_disabled` to `SearchUsers()`
  Had to add it as a `string` type not as `bool`, since if that's property
  is omitted, we would have add it to SQL request, which might be dangerous

* Restructure desctructive tests and add more
2019-07-15 09:14:32 +03:00
Alexander Zobnin
dad894f1cc
API: get list of users with additional auth info (#17305)
* batch disable users

* batch revoke users tokens

* split batch disable user and revoke token

* API: get users with auth info and isExternal flag

* fix tests for batch disable users

* Users: refactor /api/users/search endpoint

* Users: use alias for "user" table

* Chore: add BatchDisableUsers() to the bus

* Users: order user list by id explicitly

* Users: return AuthModule from /api/users/:id endpoint

* Users: do not return unused fields

* Users: fix SearchUsers method after last changes

* User: return auth module as array for future purposes

* User: tests for SearchUsers()

* User: return only latest auth module in SearchUsers()

* User: fix JOIN, get only most recent auth module
2019-06-25 18:29:07 +03:00
Oleg Gaidarenko
c853ef7318
SQLStore: extend user.SearchUsers method (#17514)
* SQLStore: extend `user.SearchUsers` method

Allow `user.SearchUsers` to search users based on their auth type
2019-06-14 09:50:38 +01:00
Alexander Zobnin
60ddad8fdb
Batch disable users (#17254)
* batch disable users

* batch revoke users tokens

* split batch disable user and revoke token

* fix tests for batch disable users

* Chore: add BatchDisableUsers() to the bus
2019-05-31 13:22:22 +03:00
Marcus Efraimsson
f845a3b841
upgrade xorm packages to latest versions 2019-03-05 21:11:23 +01:00
Marcus Efraimsson
e82b3632f6
fix signed in user for orgId=0 result should return active org id 2018-12-18 20:02:27 +01:00
danielbh
d1b8f13c66
feat: #11067 prevent removing last grafana admin permissions 2018-12-03 20:05:52 -05:00
Torkel Ödegaard
92ed1f04af sql: added code migration type 2018-08-21 13:53:04 +02:00
Marcus Efraimsson
004142a1e4
Merge pull request #12263 from grafana/11076_current_org
Set current org when adding/removing user to org
2018-06-18 11:19:42 +02:00
Marcus Efraimsson
6d48d0a80c
set current org when adding/removing user to org
To not get into a situation where a user has a current organization assign which he is
not a member of we try to always make sure that a user has a valid current organization
assigned.
2018-06-18 09:30:01 +02:00
bergquist
1181e96799 merge create user handlers 2018-06-15 21:23:57 +02:00
Torkel Ödegaard
fcaa8227a6
Dashboard acl query fixes (#10909)
* initial fixes for dashboard permission acl list query, fixes #10864

* permissions: refactoring of acl api and query
2018-02-14 15:04:26 +01:00
Torkel Ödegaard
9c6c8c0f3f acl fixes 2017-06-22 17:10:43 -04:00
Torkel Ödegaard
fcc8557dbb dashboard acl work 2017-06-21 14:11:16 -04:00
Torkel Ödegaard
c4a1803060 refactoring more renaming 2017-06-19 17:30:54 -04:00
Torkel Ödegaard
e0b9ba7554 refactoring renaming dashboard folder operations 2017-06-19 17:15:25 -04:00
Torkel Ödegaard
b494fd7689 dashboard folders acl work 2017-06-19 11:03:54 -04:00
Daniel Lee
699f9095e2 WIP: remove permissions when deleting global user 2017-06-14 23:45:30 +02:00
Daniel Lee
9efb6e76e9 users: adds search and pagination (#7753)
ref #7469. Follow up change that adds proper paging with 50 results
per page as well as a search box to search by name, login or email.
2017-03-07 16:03:54 +01:00
Daniel Lee
193d468ed3 admin: adds paging to global user list
Currently there is a limit of 1000 users in the global
user list. This change introduces paging so that an
admin can see all users and not just the first 1000.

Adds a new route to the api - /api/users/search that
returns a list of users and a total count. It takes
two parameters perpage and page that enable paging.

Fixes #7469
2017-02-13 12:59:36 +01:00