File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -497,25 +497,25 @@ func RegisterRoutes(m *macaron.Macaron) {
497
497
}
498
498
//Check issue access
499
499
if attach .IssueID != 0 {
500
- iss , err = GetIssueByID (attach .IssueID )
500
+ iss , err := models . GetIssueByID (attach .IssueID )
501
501
if err != nil {
502
502
ctx .ServerError ("GetAttachmentByUUID.GetIssueByID" , err )
503
503
return
504
504
}
505
- if ! iss .Repo .CanRead ( models .UnitTypeIssues ) {
505
+ if ! iss .Repo .CheckUnitUser ( ctx . User . ID , ctx . User . IsAdmin , models .UnitTypeIssues ) {
506
506
ctx .Error (403 )
507
507
return
508
508
}
509
509
}
510
510
511
511
//Check release access
512
512
if attach .ReleaseID != 0 {
513
- rel , err = GetReleaseByID (attach .ReleaseID )
513
+ rel , err := models . GetReleaseByID (attach .ReleaseID )
514
514
if err != nil {
515
515
ctx .ServerError ("GetAttachmentByUUID.GetReleaseByID" , err )
516
516
return
517
517
}
518
- if ! rel .Repo .CanRead ( models .UnitTypeReleases ) {
518
+ if ! rel .Repo .CheckUnitUser ( ctx . User . ID , ctx . User . IsAdmin , models .UnitTypeReleases ) {
519
519
ctx .Error (403 )
520
520
return
521
521
}
You can’t perform that action at this time.
0 commit comments