Skip to content

Commit 0787056

Browse files
adelowolafriks
authored andcommitted
Allow to add organization members as collaborators on organization owned repositories (#4748)
repository... Fixes #4507
1 parent a7ee4a6 commit 0787056

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

options/locale/locale_en-US.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,6 @@ settings.collaborator_deletion_desc = Removing a collaborator will revoke their
10531053
settings.remove_collaborator_success = The collaborator has been removed.
10541054
settings.search_user_placeholder = Search user…
10551055
settings.org_not_allowed_to_be_collaborator = Organizations cannot be added as a collaborator.
1056-
settings.user_is_org_member = The user is an organization member who cannot be added as a collaborator.
10571056
settings.add_webhook = Add Webhook
10581057
settings.add_webhook.invalid_channel_name = Webhook channel name cannot be empty and cannot contain only a # character.
10591058
settings.hooks_desc = Webhooks automatically make HTTP POST requests to a server when certain Gitea events trigger. Read more in the <a target="_blank" rel="noopener noreferrer" href="%s">webhooks guide</a>.

routers/repo/setting.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -405,19 +405,6 @@ func CollaborationPost(ctx *context.Context) {
405405
return
406406
}
407407

408-
// Check if user is organization member.
409-
if ctx.Repo.Owner.IsOrganization() {
410-
isMember, err := ctx.Repo.Owner.IsOrgMember(u.ID)
411-
if err != nil {
412-
ctx.ServerError("IsOrgMember", err)
413-
return
414-
} else if isMember {
415-
ctx.Flash.Info(ctx.Tr("repo.settings.user_is_org_member"))
416-
ctx.Redirect(ctx.Repo.RepoLink + "/settings/collaboration")
417-
return
418-
}
419-
}
420-
421408
if got, err := ctx.Repo.Repository.IsCollaborator(u.ID); err == nil && got {
422409
ctx.Flash.Error(ctx.Tr("repo.settings.add_collaborator_duplicate"))
423410
ctx.Redirect(ctx.Repo.RepoLink + "/settings/collaboration")

0 commit comments

Comments
 (0)