mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +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:
parent
733c898a90
commit
8ad2697611
3 changed files with 64 additions and 8 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue