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
319879cf
Commit
319879cf
authored
Mar 08, 2019
by
Leonard Gram
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
teams: bugfix, user pointer.
parent
90e9fda9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
pkg/services/teams/team.go
+2
-2
pkg/services/teams/teams_test.go
+4
-4
No files found.
pkg/services/teams/team.go
View file @
319879cf
...
...
@@ -5,7 +5,7 @@ import (
m
"github.com/grafana/grafana/pkg/models"
)
func
canUpdateTeam
(
orgId
int64
,
teamId
int64
,
user
m
.
SignedInUser
)
error
{
func
canUpdateTeam
(
orgId
int64
,
teamId
int64
,
user
*
m
.
SignedInUser
)
error
{
if
user
.
OrgRole
==
m
.
ROLE_ADMIN
{
return
nil
}
...
...
@@ -36,7 +36,7 @@ func canUpdateTeam(orgId int64, teamId int64, user m.SignedInUser) error {
return
m
.
ErrNotAllowedToUpdateTeam
}
func
UpdateTeam
(
user
m
.
SignedInUser
,
cmd
*
m
.
UpdateTeamCommand
)
error
{
func
UpdateTeam
(
user
*
m
.
SignedInUser
,
cmd
*
m
.
UpdateTeamCommand
)
error
{
if
err
:=
canUpdateTeam
(
cmd
.
OrgId
,
cmd
.
Id
,
user
);
err
!=
nil
{
return
err
}
...
...
pkg/services/teams/teams_test.go
View file @
319879cf
...
...
@@ -32,7 +32,7 @@ func TestUpdateTeam(t *testing.T) {
return
nil
})
err
:=
UpdateTeam
(
editor
,
&
cmd
)
err
:=
UpdateTeam
(
&
editor
,
&
cmd
)
So
(
err
,
ShouldEqual
,
m
.
ErrNotAllowedToUpdateTeam
)
})
...
...
@@ -73,7 +73,7 @@ func TestUpdateTeam(t *testing.T) {
return
nil
})
err
:=
UpdateTeam
(
editor
,
&
cmd
)
err
:=
UpdateTeam
(
&
editor
,
&
cmd
)
So
(
teamUpdated
,
ShouldBeTrue
)
So
(
err
,
ShouldBeNil
)
...
...
@@ -111,7 +111,7 @@ func TestUpdateTeam(t *testing.T) {
return
nil
})
err
:=
UpdateTeam
(
editor
,
&
cmd
)
err
:=
UpdateTeam
(
&
editor
,
&
cmd
)
So
(
err
,
ShouldEqual
,
m
.
ErrNotAllowedToUpdateTeamInDifferentOrg
)
})
...
...
@@ -142,7 +142,7 @@ func TestUpdateTeam(t *testing.T) {
return
nil
})
err
:=
UpdateTeam
(
editor
,
&
cmd
)
err
:=
UpdateTeam
(
&
editor
,
&
cmd
)
So
(
teamUpdated
,
ShouldBeTrue
)
So
(
err
,
ShouldBeNil
)
...
...
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