mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +00:00
hide issues from org private repos w/o team assignment (#4034)
This commit is contained in:
parent
46d19c4676
commit
0b3ea42847
24 changed files with 545 additions and 72 deletions
|
@ -109,6 +109,23 @@ func notifyWatchers(e Engine, act *Action) error {
|
|||
|
||||
act.ID = 0
|
||||
act.UserID = watches[i].UserID
|
||||
act.Repo.Units = nil
|
||||
|
||||
switch act.OpType {
|
||||
case ActionCommitRepo, ActionPushTag, ActionDeleteTag, ActionDeleteBranch:
|
||||
if !act.Repo.CheckUnitUser(act.UserID, false, UnitTypeCode) {
|
||||
continue
|
||||
}
|
||||
case ActionCreateIssue, ActionCommentIssue, ActionCloseIssue, ActionReopenIssue:
|
||||
if !act.Repo.CheckUnitUser(act.UserID, false, UnitTypeIssues) {
|
||||
continue
|
||||
}
|
||||
case ActionCreatePullRequest, ActionMergePullRequest, ActionClosePullRequest, ActionReopenPullRequest:
|
||||
if !act.Repo.CheckUnitUser(act.UserID, false, UnitTypePullRequests) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
if _, err = e.InsertOne(act); err != nil {
|
||||
return fmt.Errorf("insert new action: %v", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue