Refactored canRead method to get the list before checking the right (#65)
This commit is contained in:
@ -69,7 +69,6 @@ func (l *Label) hasAccessToLabel(a web.Auth) (bool, error) {
|
||||
Where("label_task.label_id != null OR labels.created_by_id = ?", u.ID).
|
||||
Or(builder.In("label_task.task_id", taskIDs)).
|
||||
And("labels.id = ?", l.ID).
|
||||
GroupBy("labels.id").
|
||||
Exist(&labels)
|
||||
return has, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user