diff options
author | Lanre Adelowo <adelowomailbox@gmail.com> | 2018-11-30 09:49:55 +0100 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2018-11-30 10:49:55 +0200 |
commit | 0787056e073f1e9ba9a7b5660dbfdec7fbf55c96 (patch) | |
tree | d262cac536b77ab8825d4dfbb558bf77347a583d | |
parent | a7ee4a6e9533fca9d6f1d354018530779637edce (diff) | |
download | gitea-0787056e073f1e9ba9a7b5660dbfdec7fbf55c96.tar.gz gitea-0787056e073f1e9ba9a7b5660dbfdec7fbf55c96.zip |
Allow to add organization members as collaborators on organization owned repositories (#4748)
repository... Fixes #4507
-rw-r--r-- | options/locale/locale_en-US.ini | 1 | ||||
-rw-r--r-- | routers/repo/setting.go | 13 |
2 files changed, 0 insertions, 14 deletions
diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 7f2aa4450a..e499bb9fe4 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1053,7 +1053,6 @@ settings.collaborator_deletion_desc = Removing a collaborator will revoke their settings.remove_collaborator_success = The collaborator has been removed. settings.search_user_placeholder = Search user… settings.org_not_allowed_to_be_collaborator = Organizations cannot be added as a collaborator. -settings.user_is_org_member = The user is an organization member who cannot be added as a collaborator. settings.add_webhook = Add Webhook settings.add_webhook.invalid_channel_name = Webhook channel name cannot be empty and cannot contain only a # character. 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>. diff --git a/routers/repo/setting.go b/routers/repo/setting.go index 61b00d793b..f815171ac5 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -405,19 +405,6 @@ func CollaborationPost(ctx *context.Context) { return } - // Check if user is organization member. - if ctx.Repo.Owner.IsOrganization() { - isMember, err := ctx.Repo.Owner.IsOrgMember(u.ID) - if err != nil { - ctx.ServerError("IsOrgMember", err) - return - } else if isMember { - ctx.Flash.Info(ctx.Tr("repo.settings.user_is_org_member")) - ctx.Redirect(ctx.Repo.RepoLink + "/settings/collaboration") - return - } - } - if got, err := ctx.Repo.Repository.IsCollaborator(u.ID); err == nil && got { ctx.Flash.Error(ctx.Tr("repo.settings.add_collaborator_duplicate")) ctx.Redirect(ctx.Repo.RepoLink + "/settings/collaboration") |