mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-04-20 03:11:35 +02:00
log warning and return custom error also when trying to report users/orgs that are not visible
This commit is contained in:
parent
9aa5624872
commit
f0e4119c32
1 changed files with 4 additions and 0 deletions
|
@ -45,6 +45,10 @@ func CanReport(ctx context.Context, doer *user.User, contentType moderation.Repo
|
|||
}
|
||||
|
||||
hasAccess = user.IsUserVisibleToViewer(ctx, reportedUser, ctx.Doer)
|
||||
if !hasAccess {
|
||||
log.Warn("User #%d wanted to report user/org #%d but they are not able to see that profile.", doer.ID, contentID)
|
||||
return false, ErrDoerNotAllowed
|
||||
}
|
||||
} else {
|
||||
// for comments and issues/pulls we need to get the parent repository
|
||||
switch contentType {
|
||||
|
|
Loading…
Add table
Reference in a new issue