Fixed checking for rights on can create for tasks
Some checks are pending
continuous-integration/drone/push Build is passing

This commit is contained in:
konrad 2019-01-14 22:34:46 +01:00
parent 80cdaa69d5
commit f6f713ee35
Signed by: konrad
GPG Key ID: F40E70337AB24C9B

View File

@ -33,7 +33,16 @@ func (t *ListTask) CanUpdate(a web.Auth) bool {
// CanCreate determines if a user has the right to create a list task
func (t *ListTask) CanCreate(a web.Auth) bool {
return t.canDoListTask(a)
doer := getUserForRights(a)
// A user can do a task if he has write acces to its list
l := &List{ID: t.ListID}
err := l.GetSimpleByID()
if err != nil {
log.Log.Error("Error occurred during CanDelete for ListTask: %s", err)
return false
}
return l.CanWrite(doer)
}
// CanRead determines if a user can read a task