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
26281dd9
Commit
26281dd9
authored
Dec 11, 2017
by
Alexander Zobnin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: format files by gofmt
parent
e4675ca5
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
37 additions
and
37 deletions
+37
-37
pkg/api/dashboard_acl.go
+1
-1
pkg/api/dashboard_acl_test.go
+1
-1
pkg/api/dtos/acl.go
+4
-4
pkg/models/dashboard_acl.go
+7
-7
pkg/models/team.go
+5
-5
pkg/models/team_member.go
+11
-11
pkg/services/sqlstore/dashboard_acl.go
+1
-1
pkg/services/sqlstore/dashboard_acl_test.go
+2
-2
pkg/services/sqlstore/team.go
+5
-5
No files found.
pkg/api/dashboard_acl.go
View file @
26281dd9
...
...
@@ -43,7 +43,7 @@ func UpdateDashboardAcl(c *middleware.Context, apiCmd dtos.UpdateDashboardAclCom
OrgId
:
c
.
OrgId
,
DashboardId
:
dashId
,
UserId
:
item
.
UserId
,
TeamId
:
item
.
TeamId
,
TeamId
:
item
.
TeamId
,
Role
:
item
.
Role
,
Permission
:
item
.
Permission
,
Created
:
time
.
Now
(),
...
...
pkg/api/dashboard_acl_test.go
View file @
26281dd9
...
...
@@ -165,7 +165,7 @@ func transformDashboardAclsToDTOs(acls []*m.DashboardAclInfoDTO) []*m.DashboardA
DashboardId
:
acl
.
DashboardId
,
Permission
:
acl
.
Permission
,
UserId
:
acl
.
UserId
,
TeamId
:
acl
.
TeamId
,
TeamId
:
acl
.
TeamId
,
}
dtos
=
append
(
dtos
,
dto
)
}
...
...
pkg/api/dtos/acl.go
View file @
26281dd9
...
...
@@ -9,8 +9,8 @@ type UpdateDashboardAclCommand struct {
}
type
DashboardAclUpdateItem
struct
{
UserId
int64
`json:"userId"`
TeamId
int64
`json:"teamId"`
Role
*
m
.
RoleType
`json:"role,omitempty"`
Permission
m
.
PermissionType
`json:"permission"`
UserId
int64
`json:"userId"`
TeamId
int64
`json:"teamId"`
Role
*
m
.
RoleType
`json:"role,omitempty"`
Permission
m
.
PermissionType
`json:"permission"`
}
pkg/models/dashboard_acl.go
View file @
26281dd9
...
...
@@ -34,10 +34,10 @@ type DashboardAcl struct {
OrgId
int64
DashboardId
int64
UserId
int64
TeamId
int64
Role
*
RoleType
// pointer to be nullable
Permission
PermissionType
UserId
int64
TeamId
int64
Role
*
RoleType
// pointer to be nullable
Permission
PermissionType
Created
time
.
Time
Updated
time
.
Time
...
...
@@ -54,8 +54,8 @@ type DashboardAclInfoDTO struct {
UserId
int64
`json:"userId"`
UserLogin
string
`json:"userLogin"`
UserEmail
string
`json:"userEmail"`
TeamId
int64
`json:"teamId"`
Team
string
`json:"team"`
TeamId
int64
`json:"teamId"`
Team
string
`json:"team"`
Role
*
RoleType
`json:"role,omitempty"`
Permission
PermissionType
`json:"permission"`
PermissionName
string
`json:"permissionName"`
...
...
@@ -74,7 +74,7 @@ type SetDashboardAclCommand struct {
DashboardId
int64
OrgId
int64
UserId
int64
TeamId
int64
TeamId
int64
Permission
PermissionType
Result
DashboardAcl
...
...
pkg/models/team.go
View file @
26281dd9
...
...
@@ -46,7 +46,7 @@ type GetTeamByIdQuery struct {
}
type
GetTeamsByUserQuery
struct
{
UserId
int64
`json:"userId"`
UserId
int64
`json:"userId"`
Result
[]
*
Team
`json:"teams"`
}
...
...
@@ -61,8 +61,8 @@ type SearchTeamsQuery struct {
}
type
SearchTeamQueryResult
struct
{
TotalCount
int64
`json:"totalCount"`
Teams
[]
*
Team
`json:"teams"`
Page
int
`json:"page"`
PerPage
int
`json:"perPage"`
TotalCount
int64
`json:"totalCount"`
Teams
[]
*
Team
`json:"teams"`
Page
int
`json:"page"`
PerPage
int
`json:"perPage"`
}
pkg/models/team_member.go
View file @
26281dd9
...
...
@@ -12,10 +12,10 @@ var (
// TeamMember model
type
TeamMember
struct
{
Id
int64
OrgId
int64
Id
int64
OrgId
int64
TeamId
int64
UserId
int64
UserId
int64
Created
time
.
Time
Updated
time
.
Time
...
...
@@ -25,13 +25,13 @@ type TeamMember struct {
// COMMANDS
type
AddTeamMemberCommand
struct
{
UserId
int64
`json:"userId" binding:"Required"`
OrgId
int64
`json:"-"`
UserId
int64
`json:"userId" binding:"Required"`
OrgId
int64
`json:"-"`
TeamId
int64
`json:"-"`
}
type
RemoveTeamMemberCommand
struct
{
UserId
int64
UserId
int64
TeamId
int64
}
...
...
@@ -40,16 +40,16 @@ type RemoveTeamMemberCommand struct {
type
GetTeamMembersQuery
struct
{
TeamId
int64
Result
[]
*
TeamMemberDTO
Result
[]
*
TeamMemberDTO
}
// ----------------------
// Projections and DTOs
type
TeamMemberDTO
struct
{
OrgId
int64
`json:"orgId"`
OrgId
int64
`json:"orgId"`
TeamId
int64
`json:"teamId"`
UserId
int64
`json:"userId"`
Email
string
`json:"email"`
Login
string
`json:"login"`
UserId
int64
`json:"userId"`
Email
string
`json:"email"`
Login
string
`json:"login"`
}
pkg/services/sqlstore/dashboard_acl.go
View file @
26281dd9
...
...
@@ -75,7 +75,7 @@ func SetDashboardAcl(cmd *m.SetDashboardAclCommand) error {
entity
:=
m
.
DashboardAcl
{
OrgId
:
cmd
.
OrgId
,
TeamId
:
cmd
.
TeamId
,
TeamId
:
cmd
.
TeamId
,
UserId
:
cmd
.
UserId
,
Created
:
time
.
Now
(),
Updated
:
time
.
Now
(),
...
...
pkg/services/sqlstore/dashboard_acl_test.go
View file @
26281dd9
...
...
@@ -183,7 +183,7 @@ func TestDashboardAclDataAccess(t *testing.T) {
Convey
(
"Should be able to add a user permission for a team"
,
func
()
{
setDashAclCmd
:=
m
.
SetDashboardAclCommand
{
OrgId
:
1
,
TeamId
:
group1
.
Result
.
Id
,
TeamId
:
group1
.
Result
.
Id
,
DashboardId
:
savedFolder
.
Id
,
Permission
:
m
.
PERMISSION_EDIT
,
}
...
...
@@ -215,7 +215,7 @@ func TestDashboardAclDataAccess(t *testing.T) {
Convey
(
"Should be able to update an existing permission for a team"
,
func
()
{
err
:=
SetDashboardAcl
(
&
m
.
SetDashboardAclCommand
{
OrgId
:
1
,
TeamId
:
group1
.
Result
.
Id
,
TeamId
:
group1
.
Result
.
Id
,
DashboardId
:
savedFolder
.
Id
,
Permission
:
m
.
PERMISSION_ADMIN
,
})
...
...
pkg/services/sqlstore/team.go
View file @
26281dd9
...
...
@@ -196,11 +196,11 @@ func AddTeamMember(cmd *m.AddTeamMemberCommand) error {
}
entity
:=
m
.
TeamMember
{
OrgId
:
cmd
.
OrgId
,
TeamId
:
cmd
.
TeamId
,
UserId
:
cmd
.
UserId
,
Created
:
time
.
Now
(),
Updated
:
time
.
Now
(),
OrgId
:
cmd
.
OrgId
,
TeamId
:
cmd
.
TeamId
,
UserId
:
cmd
.
UserId
,
Created
:
time
.
Now
(),
Updated
:
time
.
Now
(),
}
_
,
err
:=
sess
.
Insert
(
&
entity
)
...
...
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