focalboard/server/services/permissions/permissions.go
Jesús Espino f3267e2458
Fixing delete/undelete boards (#2571)
* Fixing delete/undelete boards

* Adding permissions checks for undelete board and undelete block

* Fixing server-lint

* Handling permissions for deleted boards

* Fixing linter errors

* Fixing tests

* Update server/services/store/sqlstore/board.go

Co-authored-by: Doug Lauder <wiggin77@warpmail.net>

* Fixing error message

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
2022-04-08 13:31:28 -04:00

22 lines
798 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
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)
}