Update task attachment & task comment & task rights to return the max right

This commit is contained in:
kolaente 2020-08-09 17:37:37 +02:00
parent 7a7b0962ea
commit 98c4dad64e
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
3 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ package models
import "code.vikunja.io/web"
// CanRead checks if the user can see an attachment
func (ta *TaskAttachment) CanRead(a web.Auth) (bool, error) {
func (ta *TaskAttachment) CanRead(a web.Auth) (bool, int, error) {
t := &Task{ID: ta.TaskID}
return t.CanRead(a)
}

View File

@ -20,7 +20,7 @@ package models
import "code.vikunja.io/web"
// CanRead checks if a user can read a comment
func (tc *TaskComment) CanRead(a web.Auth) (bool, error) {
func (tc *TaskComment) CanRead(a web.Auth) (bool, int, error) {
t := Task{ID: tc.TaskID}
return t.CanRead(a)
}

View File

@ -38,7 +38,7 @@ func (t *Task) CanCreate(a web.Auth) (bool, error) {
}
// CanRead determines if a user can read a task
func (t *Task) CanRead(a web.Auth) (canRead bool, err error) {
func (t *Task) CanRead(a web.Auth) (canRead bool, maxRight int, err error) {
//return t.canDoTask(a)
// Get the task, error out if it doesn't exist
*t, err = GetTaskByIDSimple(t.ID)