|
1 | | -// Copyright 2016 The Gogs Authors. All rights reserved. |
2 | | -// Copyright 2018 The Gitea Authors. All rights reserved. |
| 1 | +// Copyright 2023 The Gitea Authors. All rights reserved. |
3 | 2 | // SPDX-License-Identifier: MIT |
4 | 3 |
|
5 | 4 | package repo |
@@ -120,32 +119,23 @@ func GetIssueDependencies(ctx *context.APIContext) { |
120 | 119 | } |
121 | 120 |
|
122 | 121 | // check permission |
123 | | - if !perm.CanReadIssuesOrPulls(blocker.Issue.IsPull) { |
124 | | - if !canWrite { |
125 | | - hiddenBlocker := &issues_model.DependencyInfo{ |
126 | | - Issue: issues_model.Issue{ |
127 | | - Title: "HIDDEN", |
128 | | - }, |
129 | | - } |
130 | | - blocker = hiddenBlocker |
131 | | - } else { |
132 | | - confidentialBlocker := &issues_model.DependencyInfo{ |
133 | | - Issue: issues_model.Issue{ |
134 | | - RepoID: blocker.Issue.RepoID, |
135 | | - Index: blocker.Index, |
136 | | - Title: blocker.Title, |
137 | | - IsClosed: blocker.IsClosed, |
138 | | - IsPull: blocker.IsPull, |
139 | | - }, |
140 | | - Repository: repo_model.Repository{ |
141 | | - ID: blocker.Issue.Repo.ID, |
142 | | - Name: blocker.Issue.Repo.Name, |
143 | | - OwnerName: blocker.Issue.Repo.OwnerName, |
144 | | - }, |
145 | | - } |
146 | | - confidentialBlocker.Issue.Repo = &confidentialBlocker.Repository |
147 | | - blocker = confidentialBlocker |
| 122 | + if !perm.CanReadIssuesOrPulls(blocker.Issue.IsPull) && canWrite { |
| 123 | + confidentialBlocker := &issues_model.DependencyInfo{ |
| 124 | + Issue: issues_model.Issue{ |
| 125 | + RepoID: blocker.Issue.RepoID, |
| 126 | + Index: blocker.Index, |
| 127 | + Title: blocker.Title, |
| 128 | + IsClosed: blocker.IsClosed, |
| 129 | + IsPull: blocker.IsPull, |
| 130 | + }, |
| 131 | + Repository: repo_model.Repository{ |
| 132 | + ID: blocker.Issue.Repo.ID, |
| 133 | + Name: blocker.Issue.Repo.Name, |
| 134 | + OwnerName: blocker.Issue.Repo.OwnerName, |
| 135 | + }, |
148 | 136 | } |
| 137 | + confidentialBlocker.Issue.Repo = &confidentialBlocker.Repository |
| 138 | + blocker = confidentialBlocker |
149 | 139 | } |
150 | 140 | blockerIssues = append(blockerIssues, &blocker.Issue) |
151 | 141 | } |
|
0 commit comments