mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-14 04:09:29 +02:00
fix: correct permission loading for limited organisation
- If a organisation is set to be limited visible, then it will still be visible for signed-in users. However `UnitPermission` didn't take this into account, it does now. - Add unit test. - Resolves #6141
This commit is contained in:
parent
790f3c4861
commit
bc9f1e2533
2 changed files with 35 additions and 1 deletions
|
@ -264,7 +264,7 @@ func (org *Organization) UnitPermission(ctx context.Context, doer *user_model.Us
|
|||
}
|
||||
}
|
||||
|
||||
if org.Visibility.IsPublic() {
|
||||
if org.Visibility.IsPublic() || (org.Visibility.IsLimited() && doer != nil) {
|
||||
return perm.AccessModeRead
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue