mirror of
https://github.com/mattermost/focalboard.git
synced 2025-01-08 15:06:08 +02:00
c8e729b6fe
* refactor: updated dependency for focalboard server * chore: more dependency fixes * refactor: removed the unless code * refactor: added ctx for login and removed unnessary code * refactor: bump up go version * refactor: removed the commented code * chore: upgraded golinter version * fix: linter issue * refactor: removed feature flg fix golinter * refactor: removed feature flag from code * revert: statistic and it's function * refactor: removed ProductLimit related code * refactor: removed isWithinViewsLimit implementation * refactor: moved function GetUsedCardsCount to statistics.go from cloud.go * refactor: removed insight code board * refactor: removed limit dialog * refactor: updated dependencies for linux * chore: golinter fix * chore: updated helper test function to use newLogger * fix: go test * refactor: db ping attempts from config * revert: feature in action * revert: feature flag in action * revert: boardsEditor setting --------- Co-authored-by: Rajat Dabade <rajat@Rajats-MacBook-Pro.local>
66 lines
1.5 KiB
Go
66 lines
1.5 KiB
Go
package app
|
|
|
|
import (
|
|
"github.com/mattermost/focalboard/server/model"
|
|
"github.com/mattermost/focalboard/server/utils"
|
|
|
|
"github.com/mattermost/mattermost/server/public/shared/mlog"
|
|
)
|
|
|
|
func (a *App) GetRootTeam() (*model.Team, error) {
|
|
teamID := "0"
|
|
team, _ := a.store.GetTeam(teamID)
|
|
if team == nil {
|
|
team = &model.Team{
|
|
ID: teamID,
|
|
SignupToken: utils.NewID(utils.IDTypeToken),
|
|
}
|
|
err := a.store.UpsertTeamSignupToken(*team)
|
|
if err != nil {
|
|
a.logger.Error("Unable to initialize team", mlog.Err(err))
|
|
return nil, err
|
|
}
|
|
|
|
team, err = a.store.GetTeam(teamID)
|
|
if err != nil {
|
|
a.logger.Error("Unable to get initialized team", mlog.Err(err))
|
|
return nil, err
|
|
}
|
|
|
|
a.logger.Info("initialized team")
|
|
}
|
|
|
|
return team, nil
|
|
}
|
|
|
|
func (a *App) GetTeam(id string) (*model.Team, error) {
|
|
team, err := a.store.GetTeam(id)
|
|
if model.IsErrNotFound(err) {
|
|
return nil, nil
|
|
}
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return team, nil
|
|
}
|
|
|
|
func (a *App) GetTeamsForUser(userID string) ([]*model.Team, error) {
|
|
return a.store.GetTeamsForUser(userID)
|
|
}
|
|
|
|
func (a *App) DoesUserHaveTeamAccess(userID string, teamID string) bool {
|
|
return a.auth.DoesUserHaveTeamAccess(userID, teamID)
|
|
}
|
|
|
|
func (a *App) UpsertTeamSettings(team model.Team) error {
|
|
return a.store.UpsertTeamSettings(team)
|
|
}
|
|
|
|
func (a *App) UpsertTeamSignupToken(team model.Team) error {
|
|
return a.store.UpsertTeamSignupToken(team)
|
|
}
|
|
|
|
func (a *App) GetTeamCount() (int64, error) {
|
|
return a.store.GetTeamCount()
|
|
}
|