Skip to content

Commit 094864f

Browse files
committed
...
1 parent 83f6079 commit 094864f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

routers/routes/routes.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -497,25 +497,25 @@ func RegisterRoutes(m *macaron.Macaron) {
497497
}
498498
//Check issue access
499499
if attach.IssueID != 0 {
500-
iss, err = GetIssueByID(attach.IssueID)
500+
iss, err := models.GetIssueByID(attach.IssueID)
501501
if err != nil {
502502
ctx.ServerError("GetAttachmentByUUID.GetIssueByID", err)
503503
return
504504
}
505-
if !iss.Repo.CanRead(models.UnitTypeIssues) {
505+
if !iss.Repo.CheckUnitUser(ctx.User.ID, ctx.User.IsAdmin, models.UnitTypeIssues) {
506506
ctx.Error(403)
507507
return
508508
}
509509
}
510510

511511
//Check release access
512512
if attach.ReleaseID != 0 {
513-
rel, err = GetReleaseByID(attach.ReleaseID)
513+
rel, err := models.GetReleaseByID(attach.ReleaseID)
514514
if err != nil {
515515
ctx.ServerError("GetAttachmentByUUID.GetReleaseByID", err)
516516
return
517517
}
518-
if !rel.Repo.CanRead(models.UnitTypeReleases) {
518+
if !rel.Repo.CheckUnitUser(ctx.User.ID, ctx.User.IsAdmin, models.UnitTypeReleases) {
519519
ctx.Error(403)
520520
return
521521
}

0 commit comments

Comments
 (0)