1
0

Fixed a bug where deleting an attachment would cause a nil panic

This commit is contained in:
kolaente
2019-11-19 23:07:48 +01:00
parent c203d73b33
commit dcec9511dc
3 changed files with 65 additions and 8 deletions

View File

@ -51,6 +51,11 @@ func (t *Task) CanRead(a web.Auth) (canRead bool, err error) {
return l.CanRead(a)
}
// CanWrite checks if a user has write access to a task
func (t *Task) CanWrite(a web.Auth) (canWrite bool, err error) {
return t.canDoTask(a)
}
// Helper function to check if a user can do stuff on a list task
func (t *Task) canDoTask(a web.Auth) (bool, error) {
// Get the task