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
9de23248
Commit
9de23248
authored
Jun 22, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
You should not be able to remove a Group owner
parent
1dd66061
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
app/controllers/users_groups_controller.rb
app/controllers/users_groups_controller.rb
+1
-1
app/views/users_groups/_users_group.html.haml
app/views/users_groups/_users_group.html.haml
+1
-1
lib/tasks/migrate/migrate_groups.rake
lib/tasks/migrate/migrate_groups.rake
+16
-0
No files found.
app/controllers/users_groups_controller.rb
View file @
9de23248
...
...
@@ -18,7 +18,7 @@ class UsersGroupsController < ApplicationController
def
destroy
@users_group
=
@group
.
users_groups
.
find
(
params
[
:id
])
@users_group
.
destroy
@users_group
.
destroy
unless
@users_group
.
user
==
@group
.
owner
respond_to
do
|
format
|
format
.
html
{
redirect_to
people_group_path
(
@group
),
notice:
'User was successfully removed from group.'
}
...
...
app/views/users_groups/_users_group.html.haml
View file @
9de23248
...
...
@@ -13,6 +13,6 @@
-
else
=
member
.
human_access
-
if
show_controls
&&
user
!=
current_user
-
if
show_controls
&&
user
!=
current_user
&&
user
!=
@group
.
owner
=
link_to
group_users_group_path
(
@group
,
member
),
confirm:
remove_user_from_group_message
(
@group
,
user
),
method: :delete
,
remote:
true
,
class:
"btn-tiny btn btn-remove"
,
title:
'Remove user from group'
do
%i
.icon-minus.icon-white
lib/tasks/migrate/migrate_groups.rake
0 → 100644
View file @
9de23248
desc
"GITLAB | Migrate Gropus to match v6.0"
task
migrate_groups: :environment
do
puts
"This will add group owners to group membership"
ask_to_continue
Group
.
find_each
(
batch_size:
20
)
do
|
group
|
begin
group
.
send
:add_owner
print
'.'
rescue
=>
ex
puts
ex
.
message
print
'F'
end
end
end
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