Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ed680349
Commit
ed680349
authored
Mar 17, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't allow project to be shared with the group it is already in.
parent
fa9da48b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
6 deletions
+23
-6
CHANGELOG-EE
CHANGELOG-EE
+1
-0
app/assets/javascripts/groups_select.js.coffee
app/assets/javascripts/groups_select.js.coffee
+8
-1
app/helpers/selects_helper.rb
app/helpers/selects_helper.rb
+1
-1
app/models/project_group_link.rb
app/models/project_group_link.rb
+9
-0
app/views/projects/group_links/index.html.haml
app/views/projects/group_links/index.html.haml
+1
-1
db/schema.rb
db/schema.rb
+3
-3
No files found.
CHANGELOG-EE
View file @
ed680349
...
...
@@ -5,6 +5,7 @@ v 7.9.0 (unreleased)
- Use one custom header logo for all GitLab themes in appearance settings
- Escape wildcards when searching LDAP by group name.
- Group level Web Hooks
- Don't allow project to be shared with the group it is already in.
v 7.8.0
- Improved Jira issue closing integration
...
...
app/assets/javascripts/groups_select.js.coffee
View file @
ed680349
...
...
@@ -2,6 +2,7 @@ class @GroupsSelect
constructor
:
->
$
(
'.ajax-groups-select'
).
each
(
i
,
select
)
=>
skip_ldap
=
$
(
select
).
hasClass
(
'skip_ldap'
)
skip_group
=
$
(
select
).
data
(
"skip-group"
)
$
(
select
).
select2
placeholder
:
"Search for a group"
...
...
@@ -9,7 +10,13 @@ class @GroupsSelect
minimumInputLength
:
0
query
:
(
query
)
->
Api
.
groups
query
.
term
,
skip_ldap
,
(
groups
)
->
data
=
{
results
:
groups
}
data
=
{
results
:
[]
}
for
group
in
groups
continue
if
skip_group
&&
group
.
path
==
skip_group
data
.
results
.
push
(
group
)
query
.
callback
(
data
)
initSelection
:
(
element
,
callback
)
->
...
...
app/helpers/selects_helper.rb
View file @
ed680349
...
...
@@ -33,7 +33,7 @@ module SelectsHelper
css_class
<<
(
opts
[
:class
]
||
''
)
value
=
opts
[
:selected
]
||
''
hidden_field_tag
(
id
,
value
,
class:
css_class
)
hidden_field_tag
(
id
,
value
,
class:
css_class
,
data:
{
skip_group:
opts
[
:skip_group
]
}
)
end
def
admin_email_select_tag
(
id
,
opts
=
{})
...
...
app/models/project_group_link.rb
View file @
ed680349
...
...
@@ -12,6 +12,7 @@ class ProjectGroupLink < ActiveRecord::Base
validates
:group_id
,
uniqueness:
{
scope:
[
:project_id
],
message:
"already shared with this group"
}
validates
:group_access
,
presence:
true
validates
:group_access
,
inclusion:
{
in:
Gitlab
::
Access
.
values
},
presence:
true
validate
:different_group
def
self
.
access_options
Gitlab
::
Access
.
options
...
...
@@ -24,4 +25,12 @@ class ProjectGroupLink < ActiveRecord::Base
def
human_access
self
.
class
.
access_options
.
key
(
self
.
group_access
)
end
private
def
different_group
if
self
.
group
&&
self
.
project
&&
self
.
project
.
group
==
self
.
group
errors
.
add
(
:base
,
"Project cannot be shared with the project it is in."
)
end
end
end
app/views/projects/group_links/index.html.haml
View file @
ed680349
...
...
@@ -29,7 +29,7 @@
.form-group
=
label_tag
:link_group_id
,
'Group'
,
class:
'control-label'
.col-sm-10
=
groups_select_tag
(
:link_group_id
)
=
groups_select_tag
(
:link_group_id
,
skip_group:
@project
.
group
.
try
(
:path
)
)
.form-group
=
label_tag
:link_group_access
,
'Max access level'
,
class:
'control-label'
.col-sm-10
...
...
db/schema.rb
View file @
ed680349
...
...
@@ -394,11 +394,11 @@ ActiveRecord::Schema.define(version: 20150312000132) do
t
.
string
"avatar"
t
.
string
"import_status"
t
.
float
"repository_size"
,
default:
0.0
t
.
text
"merge_requests_template"
t
.
integer
"star_count"
,
default:
0
,
null:
false
t
.
boolean
"merge_requests_rebase_enabled"
,
default:
false
t
.
string
"import_type"
t
.
string
"import_source"
t
.
text
"merge_requests_template"
t
.
boolean
"merge_requests_rebase_enabled"
,
default:
false
t
.
boolean
"merge_requests_rebase_default"
,
default:
true
end
...
...
@@ -514,7 +514,6 @@ ActiveRecord::Schema.define(version: 20150312000132) do
t
.
string
"unconfirmed_email"
t
.
boolean
"hide_no_ssh_key"
,
default:
false
t
.
string
"website_url"
,
default:
""
,
null:
false
t
.
datetime
"admin_email_unsubscribed_at"
t
.
string
"github_access_token"
t
.
string
"gitlab_access_token"
t
.
string
"notification_email"
...
...
@@ -522,6 +521,7 @@ ActiveRecord::Schema.define(version: 20150312000132) do
t
.
boolean
"password_automatically_set"
,
default:
false
t
.
string
"bitbucket_access_token"
t
.
string
"bitbucket_access_token_secret"
t
.
datetime
"admin_email_unsubscribed_at"
end
add_index
"users"
,
[
"admin"
],
name:
"index_users_on_admin"
,
using: :btree
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment