main

mattermost/focalboard

Last updated at: 29/12/2023 09:41

sharing.go

TLDR

This file contains two methods that handle sharing functionality in the application.

Methods

GetSharing

This method retrieves the sharing information for a specific board. It takes the boardID as a parameter and returns the sharing details in the form of a model.Sharing struct. If an error occurs during the retrieval process, it returns the error.

UpsertSharing

This method updates or inserts the sharing information for a board. It takes the sharing information as a model.Sharing struct and updates the corresponding record in the store. If an error occurs during the update or insert process, it returns the error.

package app

import (
	"github.com/mattermost/focalboard/server/model"
)

func (a *App) GetSharing(boardID string) (*model.Sharing, error) {
	sharing, err := a.store.GetSharing(boardID)
	if err != nil {
		return nil, err
	}
	return sharing, nil
}

func (a *App) UpsertSharing(sharing model.Sharing) error {
	return a.store.UpsertSharing(sharing)
}