Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
804bff55
Commit
804bff55
authored
Jan 15, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Accounts admin view/get api
parent
fdfcc3ab
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
6 deletions
+8
-6
grafana
+1
-1
pkg/api/api.go
+1
-1
pkg/models/account.go
+5
-3
pkg/services/sqlstore/accounts.go
+1
-1
No files found.
grafana
@
5b93e097
Subproject commit
cf344abff2cdf7638d1748aa698caf23c3848715
Subproject commit
5b93e09714dbee6c1c181daf0182704334d8c6be
pkg/api/api.go
View file @
804bff55
...
...
@@ -10,7 +10,7 @@ import (
// Register adds http routes
func
Register
(
m
*
macaron
.
Macaron
)
{
reqSignedIn
:=
middleware
.
Auth
(
&
middleware
.
AuthOptions
{
ReqSignedIn
:
true
})
reqAdmin
:=
middleware
.
Auth
(
&
middleware
.
AuthOptions
{
ReqSignedIn
:
true
,
ReqAdmin
:
fals
e
})
reqAdmin
:=
middleware
.
Auth
(
&
middleware
.
AuthOptions
{
ReqSignedIn
:
true
,
ReqAdmin
:
tru
e
})
// not logged in views
m
.
Get
(
"/"
,
reqSignedIn
,
Index
)
...
...
pkg/models/account.go
View file @
804bff55
...
...
@@ -95,9 +95,11 @@ type CollaboratorDTO struct {
}
type
AccountSearchHitDTO
struct
{
Id
int64
`json:"id"`
Name
string
`json:"name"`
Email
string
`json:"email"`
Id
int64
`json:"id"`
Name
string
`json:"name"`
Login
string
`json:"login"`
Email
string
`json:"email"`
IsAdmin
bool
`json:"isAdmin"`
}
type
AccountDTO
struct
{
...
...
pkg/services/sqlstore/accounts.go
View file @
804bff55
...
...
@@ -188,7 +188,7 @@ func SearchAccounts(query *m.SearchAccountsQuery) error {
sess
:=
x
.
Table
(
"account"
)
sess
.
Where
(
"email LIKE ?"
,
query
.
Query
+
"%"
)
sess
.
Limit
(
query
.
Limit
,
query
.
Limit
*
query
.
Page
)
sess
.
Cols
(
"id"
,
"email"
,
"name"
)
sess
.
Cols
(
"id"
,
"email"
,
"name"
,
"login"
,
"is_admin"
)
err
:=
sess
.
Find
(
&
query
.
Result
)
return
err
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment