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
ed879df1
Commit
ed879df1
authored
Jan 16, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Corrected spelling of SignedInUser (was SignInUser)
parent
2b05dac0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
pkg/middleware/middleware.go
+6
-6
pkg/models/account.go
+2
-2
pkg/services/sqlstore/accounts.go
+1
-1
No files found.
pkg/middleware/middleware.go
View file @
ed879df1
...
@@ -16,7 +16,7 @@ import (
...
@@ -16,7 +16,7 @@ import (
type
Context
struct
{
type
Context
struct
{
*
macaron
.
Context
*
macaron
.
Context
*
m
.
SignInUser
*
m
.
Sign
ed
InUser
Session
session
.
Store
Session
session
.
Store
...
@@ -37,7 +37,7 @@ func GetContextHandler() macaron.Handler {
...
@@ -37,7 +37,7 @@ func GetContextHandler() macaron.Handler {
log
.
Error
(
3
,
"Failed to get user by id, %v, %v"
,
accountId
,
err
)
log
.
Error
(
3
,
"Failed to get user by id, %v, %v"
,
accountId
,
err
)
}
else
{
}
else
{
ctx
.
IsSignedIn
=
true
ctx
.
IsSignedIn
=
true
ctx
.
SignInUser
=
query
.
Result
ctx
.
Sign
ed
InUser
=
query
.
Result
}
}
}
else
if
token
:=
getApiToken
(
ctx
);
token
!=
""
{
}
else
if
token
:=
getApiToken
(
ctx
);
token
!=
""
{
// Try API Key auth
// Try API Key auth
...
@@ -54,12 +54,12 @@ func GetContextHandler() macaron.Handler {
...
@@ -54,12 +54,12 @@ func GetContextHandler() macaron.Handler {
}
}
ctx
.
IsSignedIn
=
true
ctx
.
IsSignedIn
=
true
ctx
.
SignInUser
=
query
.
Result
ctx
.
Sign
ed
InUser
=
query
.
Result
// api key role
// api key role
ctx
.
SignInUser
.
UserRole
=
tokenInfo
.
Role
ctx
.
UserRole
=
tokenInfo
.
Role
ctx
.
SignInUser
.
UsingAccountId
=
ctx
.
SignInUser
.
AccountId
ctx
.
UsingAccountId
=
ctx
.
AccountId
ctx
.
SignInUser
.
UsingAccountName
=
ctx
.
SignInUser
.
UserName
ctx
.
UsingAccountName
=
ctx
.
UserName
}
}
}
}
...
...
pkg/models/account.go
View file @
ed879df1
...
@@ -87,12 +87,12 @@ type SearchAccountsQuery struct {
...
@@ -87,12 +87,12 @@ type SearchAccountsQuery struct {
type
GetSignedInUserQuery
struct
{
type
GetSignedInUserQuery
struct
{
AccountId
int64
AccountId
int64
Result
*
SignInUser
Result
*
Sign
ed
InUser
}
}
// ------------------------
// ------------------------
// DTO & Projections
// DTO & Projections
type
SignInUser
struct
{
type
Sign
ed
InUser
struct
{
AccountId
int64
AccountId
int64
UsingAccountId
int64
UsingAccountId
int64
UsingAccountName
string
UsingAccountName
string
...
...
pkg/services/sqlstore/accounts.go
View file @
ed879df1
...
@@ -174,7 +174,7 @@ func GetSignedInUser(query *m.GetSignedInUserQuery) error {
...
@@ -174,7 +174,7 @@ func GetSignedInUser(query *m.GetSignedInUserQuery) error {
LEFT OUTER JOIN collaborator on collaborator.account_id = usingAccount.id AND collaborator.collaborator_id = userAccount.id
LEFT OUTER JOIN collaborator on collaborator.account_id = usingAccount.id AND collaborator.collaborator_id = userAccount.id
WHERE userAccount.id=?`
WHERE userAccount.id=?`
var
user
m
.
SignInUser
var
user
m
.
Sign
ed
InUser
sess
:=
x
.
Table
(
"account"
)
sess
:=
x
.
Table
(
"account"
)
has
,
err
:=
sess
.
Sql
(
rawSql
,
query
.
AccountId
)
.
Get
(
&
user
)
has
,
err
:=
sess
.
Sql
(
rawSql
,
query
.
AccountId
)
.
Get
(
&
user
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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