Skip to content
Snippets Groups Projects
Verified Commit 9a95b155 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Add share project from group lock

parent 068fd5de
No related branches found
No related tags found
No related merge requests found
Loading
@@ -133,7 +133,7 @@ class GroupsController < Groups::ApplicationController
Loading
@@ -133,7 +133,7 @@ class GroupsController < Groups::ApplicationController
end end
   
def group_params def group_params
params.require(:group).permit(:name, :description, :path, :avatar, :public) params.require(:group).permit(:name, :description, :path, :avatar, :public, :share_with_group_lock)
end end
   
def load_events def load_events
Loading
Loading
Loading
@@ -881,8 +881,7 @@ class Project < ActiveRecord::Base
Loading
@@ -881,8 +881,7 @@ class Project < ActiveRecord::Base
end end
   
def allowed_to_share_with_group? def allowed_to_share_with_group?
# TODO: replace with logic !namespace.share_with_group_lock
true
end end
   
def ci_commit(sha) def ci_commit(sha)
Loading
Loading
Loading
@@ -23,6 +23,15 @@
Loading
@@ -23,6 +23,15 @@
%hr %hr
= link_to 'Remove avatar', group_avatar_path(@group.to_param), data: { confirm: "Group avatar will be removed. Are you sure?"}, method: :delete, class: "btn btn-remove btn-sm remove-avatar" = link_to 'Remove avatar', group_avatar_path(@group.to_param), data: { confirm: "Group avatar will be removed. Are you sure?"}, method: :delete, class: "btn btn-remove btn-sm remove-avatar"
   
.form-group
%hr
= f.label :share_with_group_lock, class: 'control-label' do
Share with group lock
.col-sm-10
.checkbox
= f.check_box :share_with_group_lock
%span.descr Prevent sharing a project with another group within this group
.form-actions .form-actions
= f.submit 'Save group', class: "btn btn-save" = f.submit 'Save group', class: "btn btn-save"
   
Loading
Loading
class AddGroupShareLock < ActiveRecord::Migration
def change
add_column :namespaces, :share_with_group_lock, :boolean, default: false
end
end
Loading
@@ -568,14 +568,15 @@ ActiveRecord::Schema.define(version: 20160309140734) do
Loading
@@ -568,14 +568,15 @@ ActiveRecord::Schema.define(version: 20160309140734) do
add_index "milestones", ["title"], name: "index_milestones_on_title", using: :btree add_index "milestones", ["title"], name: "index_milestones_on_title", using: :btree
   
create_table "namespaces", force: :cascade do |t| create_table "namespaces", force: :cascade do |t|
t.string "name", null: false t.string "name", null: false
t.string "path", null: false t.string "path", null: false
t.integer "owner_id" t.integer "owner_id"
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
t.string "type" t.string "type"
t.string "description", default: "", null: false t.string "description", default: "", null: false
t.string "avatar" t.string "avatar"
t.boolean "share_with_group_lock", default: false
end end
   
add_index "namespaces", ["created_at", "id"], name: "index_namespaces_on_created_at_and_id", using: :btree add_index "namespaces", ["created_at", "id"], name: "index_namespaces_on_created_at_and_id", using: :btree
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment