46fdbf9048
* Initial Boards+Channels implementation * Adding draft code to list the boards in a channel * Adding the hability to link/unlink channels (fake channel for now) * Simplify slight the migrations * WIP * More changes to improve the implementation * Adding partial implementation of linking channel from board * Allow linking in both directions * Removing unused file * More work on channel binding * some refactoring * Improving code quality and interface * More improvements * Changing the API to search channels * Adding a limit of 10 channels in search * Add confirmation on linking public channels * Improve a bit the styling of the confirmation modal * Showing the current linked channel * Adding link board confirmation to channel interface * Fixing tests and linter errors * Fixing backend tests * Adding permissions tests * Fixing linter errors * Fixing small things * Fixing some typescript errors * Adding new boardSelectorItem tests * Improving a bit tests * Adding jest unit tests * Remove duplicated implementation (from merge, I guess) * Adding missed files * Addressing some of the PR review comments * Removing unneeded new wrapIntl implementation * Moving NotSupportedError to the store package to be share between all the store implementations or layers * Fixing one of the pendings ToDo * Creating a constructor for the NotSupportedError * Fixing linter error
23 lines
885 B
Go
23 lines
885 B
Go
//go:generate mockgen --build_flags=--mod=mod -destination=mocks/mockstore.go -package mocks . Store
|
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
package permissions
|
|
|
|
import (
|
|
"github.com/mattermost/focalboard/server/model"
|
|
|
|
mmModel "github.com/mattermost/mattermost-server/v6/model"
|
|
)
|
|
|
|
type PermissionsService interface {
|
|
HasPermissionToTeam(userID, teamID string, permission *mmModel.Permission) bool
|
|
HasPermissionToChannel(userID, channelID string, permission *mmModel.Permission) bool
|
|
HasPermissionToBoard(userID, boardID string, permission *mmModel.Permission) bool
|
|
}
|
|
|
|
type Store interface {
|
|
GetBoard(boardID string) (*model.Board, error)
|
|
GetMemberForBoard(boardID, userID string) (*model.BoardMember, error)
|
|
GetBoardHistory(boardID string, opts model.QueryBoardHistoryOptions) ([]*model.Board, error)
|
|
}
|