Added rights methods
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
kolaente 2019-10-10 13:14:17 +02:00
parent 05c71b6c75
commit c6152d63f2
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 6 additions and 4 deletions

View File

@ -19,13 +19,15 @@ package models
import "code.vikunja.io/web"
// CanRead checks if the user can see an attachment
func (ta *TaskAttachment) CanRead(web.Auth) (bool, error) {
panic("implement me")
func (ta *TaskAttachment) CanRead(a web.Auth) (bool, error) {
t := Task{ID: ta.TaskID}
return t.CanRead(a)
}
// CanDelete checks if the user can delete an attachment
func (ta *TaskAttachment) CanDelete(web.Auth) (bool, error) {
panic("implement me")
func (ta *TaskAttachment) CanDelete(a web.Auth) (bool, error) {
t := Task{ID: ta.TaskID}
return t.CanWrite(a)
}
// CanCreate checks if the user can create an attachment