1
0

Implemented creating a team <-> list relation

This commit is contained in:
kolaente
2018-07-24 17:29:13 +02:00
committed by konrad
parent 6ff10e6353
commit edf9b6f2c7
12 changed files with 113 additions and 48 deletions

View File

@ -175,6 +175,22 @@ func (err ErrNeedToBeListWriter) Error() string {
return fmt.Sprintf("You need to have write acces to the list to do that [ListID: %d, UserID: %d]", err.ListID, err.UserID)
}
// ErrNeedToHaveListReadAccess represents an error, where the user dont has read access to that List
type ErrNeedToHaveListReadAccess struct {
ListID int64
UserID int64
}
// IsErrNeedToHaveListReadAccess checks if an error is a ErrListDoesNotExist.
func IsErrNeedToHaveListReadAccess(err error) bool {
_, ok := err.(ErrNeedToHaveListReadAccess)
return ok
}
func (err ErrNeedToHaveListReadAccess) Error() string {
return fmt.Sprintf("You need to be List owner to do that [ListID: %d, UserID: %d]", err.ListID, err.UserID)
}
// ================
// List item errors
// ================
@ -406,7 +422,7 @@ func (err ErrTeamDoesNotExist) Error() string {
// ErrInvalidTeamRight represents an error where a team right is invalid
type ErrInvalidTeamRight struct {
Right NamespaceRight
Right TeamRight
}
// IsErrInvalidTeamRight checks if an error is ErrInvalidTeamRight.