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.' }
- 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
--- /dev/null
+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
+