mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Recalculate repository access only for specific user (#8481)
* Recalculate repository access only for specific user Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Handle user repositories as well, and only add access if minimum mode * Need to get repo owner to check if organization
This commit is contained in:
committed by
zeripath
parent
733c898a90
commit
8ad2697611
@@ -723,7 +723,7 @@ func AddTeamMember(team *Team, userID int64) error {
|
||||
|
||||
// Give access to team repositories.
|
||||
for _, repo := range team.Repos {
|
||||
if err := repo.recalculateTeamAccesses(sess, 0); err != nil {
|
||||
if err := repo.recalculateUserAccess(sess, userID); err != nil {
|
||||
return err
|
||||
}
|
||||
if setting.Service.AutoWatchNewRepos {
|
||||
@@ -768,7 +768,7 @@ func removeTeamMember(e *xorm.Session, team *Team, userID int64) error {
|
||||
|
||||
// Delete access to team repositories.
|
||||
for _, repo := range team.Repos {
|
||||
if err := repo.recalculateTeamAccesses(e, 0); err != nil {
|
||||
if err := repo.recalculateUserAccess(e, userID); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user