Fixed a bug where deleting an attachment would cause a nil panic
This commit is contained in:
parent
c203d73b33
commit
dcec9511dc
3 changed files with 65 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
Reference in a new issue