Update task attachment & task comment & task rights to return the max right
This commit is contained in:
parent
7a7b0962ea
commit
98c4dad64e
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue