Skip to content

Commit 739291d

Browse files
committed
improve code
1 parent 1698005 commit 739291d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

models/repo_permission.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@ func (p *Permission) UnitAccessMode(unitType UnitType) AccessMode {
6060
func (p *Permission) CanAnonymousAccess(unitType UnitType) bool {
6161
for _, u := range p.Units {
6262
if u.Type == unitType {
63-
if u.AllowAnonymous {
64-
return true
65-
}
63+
return u.AllowAnonymous
6664
}
6765
}
6866
return false

0 commit comments

Comments
 (0)