summaryrefslogtreecommitdiff
path: root/spec/models/project_group_link_spec.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@gitlab.com>2016-10-11 10:20:35 +0000
committerRémy Coutable <remy@rymai.me>2016-10-11 20:36:26 +0200
commit670b2eb5c05a721f810a5b248612cadde0eaf2ce (patch)
tree68b5ceaba026d6b9fd9b1215742ead2a056eb9b6 /spec/models/project_group_link_spec.rb
parentb0acc0a308848529727e8bcf2a7c6e2bc0f76303 (diff)
downloadgitlab-ce-670b2eb5c05a721f810a5b248612cadde0eaf2ce.tar.gz
Merge branch 'api-fix-project-group-sharing' into 'security'
API: Share projects only with groups current_user can access Aims to address the issues here: https://gitlab.com/gitlab-org/gitlab-ce/issues/23004 * Projects can be shared with non-existent groups * Projects can be shared with groups that the current user does not have access to read Concerns: The new implementation of the API endpoint allows projects to be shared with a larger range of groups than can be done via the web UI. The form for sharing a project with a group uses the following API endpoint to index the available groups: https://gitlab.com/gitlab-org/gitlab-ce/blob/494269fc92f61098ee6bd635a0426129ce2c5456/lib/api/groups.rb#L17. The groups indexed in the web form will only be those groups that the user is currently a member of. The new implementation allows projects to be shared with any group that the authenticated user has access to view. This widens the range of groups to those that are public and internal. See merge request !2005 Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/models/project_group_link_spec.rb')
-rw-r--r--spec/models/project_group_link_spec.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/models/project_group_link_spec.rb b/spec/models/project_group_link_spec.rb
index 2fa6715fcaf..c5ff1941378 100644
--- a/spec/models/project_group_link_spec.rb
+++ b/spec/models/project_group_link_spec.rb
@@ -11,7 +11,7 @@ describe ProjectGroupLink do
it { should validate_presence_of(:project_id) }
it { should validate_uniqueness_of(:group_id).scoped_to(:project_id).with_message(/already shared/) }
- it { should validate_presence_of(:group_id) }
+ it { should validate_presence_of(:group) }
it { should validate_presence_of(:group_access) }
end
end