Check your credentials from session
Этот коммит содержится в:
@@ -271,7 +271,7 @@ func (c *Context) IsTeamAdmin(userId string) bool {
|
|||||||
return false
|
return false
|
||||||
} else {
|
} else {
|
||||||
user := uresult.Data.(*model.User)
|
user := uresult.Data.(*model.User)
|
||||||
return strings.Contains(user.Roles, model.ROLE_ADMIN) && user.TeamId == c.Session.TeamId
|
return strings.Contains(c.Session.Roles, model.ROLE_ADMIN) && user.TeamId == c.Session.TeamId
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCreatePost(t *testing.T) {
|
func TestCreatePost(t *testing.T) {
|
||||||
@@ -534,6 +535,10 @@ func TestDeletePosts(t *testing.T) {
|
|||||||
|
|
||||||
Client.LoginByEmail(team.Domain, userAdmin.Email, "pwd")
|
Client.LoginByEmail(team.Domain, userAdmin.Email, "pwd")
|
||||||
|
|
||||||
|
fmt.Println(userAdmin.Email)
|
||||||
|
fmt.Println(team.Email)
|
||||||
|
fmt.Println(userAdmin.Roles)
|
||||||
|
|
||||||
Client.Must(Client.DeletePost(channel1.Id, post4.Id))
|
Client.Must(Client.DeletePost(channel1.Id, post4.Id))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user