Commit fd166146 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Remove can_create_team code from user

parent 606701ad
class ApplicationController < ActionController::Base
before_filter :authenticate_user! before_filter :authenticate_user!
before_filter :reject_blocked! before_filter :reject_blocked!
before_filter :check_password_expiration before_filter :check_password_expiration
...@@ -95,10 +94,6 @@ class ApplicationController < ActionController::Base ...@@ -95,10 +94,6 @@ class ApplicationController < ActionController::Base
return access_denied! unless can?(current_user, :push_code, project) return access_denied! unless can?(current_user, :push_code, project)
end end
def authorize_create_team!
return access_denied! unless can?(current_user, :create_team, nil)
end
def access_denied! def access_denied!
render "errors/access_denied", layout: "errors", status: 404 render "errors/access_denied", layout: "errors", status: 404
end end
......
...@@ -47,7 +47,7 @@ class User < ActiveRecord::Base ...@@ -47,7 +47,7 @@ class User < ActiveRecord::Base
:extern_uid, :provider, :password_expires_at, :extern_uid, :provider, :password_expires_at,
as: [:default, :admin] as: [:default, :admin]
attr_accessible :projects_limit, :can_create_team, :can_create_group, attr_accessible :projects_limit, :can_create_group,
as: :admin as: :admin
attr_accessor :force_random_password attr_accessor :force_random_password
...@@ -208,7 +208,6 @@ class User < ActiveRecord::Base ...@@ -208,7 +208,6 @@ class User < ActiveRecord::Base
tap do |u| tap do |u|
u.projects_limit = Gitlab.config.gitlab.default_projects_limit u.projects_limit = Gitlab.config.gitlab.default_projects_limit
u.can_create_group = Gitlab.config.gitlab.default_can_create_group u.can_create_group = Gitlab.config.gitlab.default_can_create_group
u.can_create_team = Gitlab.config.gitlab.default_can_create_team
u.theme_id = Gitlab::Theme::MARS u.theme_id = Gitlab::Theme::MARS
end end
end end
......
...@@ -56,10 +56,6 @@ ...@@ -56,10 +56,6 @@
= f.label :can_create_group = f.label :can_create_group
.controls= f.check_box :can_create_group .controls= f.check_box :can_create_group
.control-group
= f.label :can_create_team
.controls= f.check_box :can_create_team
.control-group .control-group
= f.label :admin do = f.label :admin do
%strong.cred Administrator %strong.cred Administrator
......
...@@ -41,7 +41,6 @@ production: &base ...@@ -41,7 +41,6 @@ production: &base
## User settings ## User settings
default_projects_limit: 10 default_projects_limit: 10
# default_can_create_group: false # default: true # default_can_create_group: false # default: true
# default_can_create_team: false # default: true
# username_changing_enabled: false # default: true - User can change her username/namespace # username_changing_enabled: false # default: true - User can change her username/namespace
## Users management ## Users management
......
...@@ -52,7 +52,6 @@ Settings['issues_tracker'] ||= {} ...@@ -52,7 +52,6 @@ Settings['issues_tracker'] ||= {}
Settings['gitlab'] ||= Settingslogic.new({}) Settings['gitlab'] ||= Settingslogic.new({})
Settings.gitlab['default_projects_limit'] ||= 10 Settings.gitlab['default_projects_limit'] ||= 10
Settings.gitlab['default_can_create_group'] = true if Settings.gitlab['default_can_create_group'].nil? Settings.gitlab['default_can_create_group'] = true if Settings.gitlab['default_can_create_group'].nil?
Settings.gitlab['default_can_create_team'] = true if Settings.gitlab['default_can_create_team'].nil?
Settings.gitlab['host'] ||= 'localhost' Settings.gitlab['host'] ||= 'localhost'
Settings.gitlab['https'] = false if Settings.gitlab['https'].nil? Settings.gitlab['https'] = false if Settings.gitlab['https'].nil?
Settings.gitlab['port'] ||= Settings.gitlab.https ? 443 : 80 Settings.gitlab['port'] ||= Settings.gitlab.https ? 443 : 80
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment