gitea/models
Bjarne Koll 2f3da6d6b3
Correctly override user unitmodes (#35501)
Commit 6a97ab0af4 reworked team permission
application. The introduced logic overrode the unitModes for *every*
team a user is in, max(...) the current value and the team value
together.

The logic completely fails in case the team does not have a unit for the
specific unit type defined, in which case the logic inserted the
minimumVisibility, overriding any previous aggregation of access modes
for the unit.

This is resolved by simply always merging the unit access mode of the
team as it will simply default to None in case the team does not have a
permission defined for the unit, which will be swallowed by the max(..)
call in favour of the previous aggregated permission.
2025-09-17 12:26:58 -07:00
..
actions Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
activities Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
admin Fix omitempty bug (#33663) 2025-02-20 12:39:21 -08:00
asymkey Fix SSH signing key path will be displayed in the pull request UI (#35381) 2025-09-12 03:00:18 +00:00
auth Refactor db package (#35380) 2025-08-30 01:04:06 +08:00
avatars Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
db Fix various typos in codebase (#35480) 2025-09-13 10:34:43 -04:00
dbfs Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
fixtures check user and repo for redirects when using git via SSH transport (#35416) 2025-09-09 20:13:41 +00:00
git Replace gobwas/glob package (#35478) 2025-09-13 18:01:00 +00:00
issues Extend comment treepath length (#35389) 2025-09-10 13:31:59 +00:00
migrations Move git command to git/gitcmd (#35483) 2025-09-15 23:33:12 -07:00
organization Refactor db package (#35380) 2025-08-30 01:04:06 +08:00
packages Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
perm Correctly override user unitmodes (#35501) 2025-09-17 12:26:58 -07:00
project Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
pull Start automerge check again after the conflict check and the schedule (#34989) 2025-07-08 14:51:16 +00:00
renderhelper Fix commit message rendering and some UI problems (#34680) 2025-06-10 23:20:32 +08:00
repo Move some functions from package git to gitrepo (#33910) 2025-09-01 19:13:18 +00:00
secret Added Description Field for Secrets and Variables (#33526) 2025-03-17 19:24:54 +00:00
shared/types Refactor locale&string&template related code (#29165) 2024-02-14 21:48:45 +00:00
system Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
unit Run `gopls modernize` on codebase (#34751) 2025-06-18 01:48:09 +00:00
unittest Refactor db package (#35380) 2025-08-30 01:04:06 +08:00
user Fix various typos in codebase (#35480) 2025-09-13 10:34:43 -04:00
webhook Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
main_test.go make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
repo.go Use db.WithTx/WithTx2 instead of TxContext when possible (#35130) 2025-07-22 10:02:01 -07:00
repo_test.go Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00