summaryrefslogtreecommitdiff
path: root/lib/api/projects.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r--lib/api/projects.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 56a5f3c94f3..007d88d4853 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -264,6 +264,10 @@ module API
post ":id/share" do
authorize! :admin_project, user_project
required_attributes! [:group_id, :group_access]
+
+ unless user_project.allowed_to_share_with_group?
+ return render_api_error!("The project sharing with group is disabled")
+ end
link = user_project.project_group_links.new
link.group_id = params[:group_id]