Update link share rights to return the max right

This commit is contained in:
kolaente 2020-08-09 17:18:04 +02:00
parent d57f030687
commit bf22c1e0fb
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 3 additions and 3 deletions

View File

@ -19,15 +19,15 @@ package models
import "code.vikunja.io/web"
// CanRead implements the read right check for a link share
func (share *LinkSharing) CanRead(a web.Auth) (bool, error) {
func (share *LinkSharing) CanRead(a web.Auth) (bool, int, error) {
// Don't allow creating link shares if the user itself authenticated with a link share
if _, is := a.(*LinkSharing); is {
return false, nil
return false, 0, nil
}
l, err := GetListByShareHash(share.Hash)
if err != nil {
return false, err
return false, 0, err
}
return l.CanRead(a)
}