Prevent anonymous container access if RequireSignInView is enabled (#28877)

Fixes #28875

If `RequireSignInView` is enabled, the ghost user has no access rights.
This commit is contained in:
KN4CK3R 2024-01-21 17:31:29 +01:00 committed by GitHub
parent b693611b35
commit caad931385
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 24 additions and 6 deletions

View file

@ -93,7 +93,7 @@ func packageAssignment(ctx *packageAssignmentCtx, errCb func(int, string, any))
}
func determineAccessMode(ctx *Base, pkg *Package, doer *user_model.User) (perm.AccessMode, error) {
if setting.Service.RequireSignInView && doer == nil {
if setting.Service.RequireSignInView && (doer == nil || doer.IsGhost()) {
return perm.AccessModeNone, nil
}