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
fd166146
Commit
fd166146
authored
Aug 21, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove can_create_team code from user
parent
606701ad
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1 addition
and
13 deletions
+1
-13
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+0
-5
app/models/user.rb
app/models/user.rb
+1
-2
app/views/admin/users/_form.html.haml
app/views/admin/users/_form.html.haml
+0
-4
config/gitlab.yml.example
config/gitlab.yml.example
+0
-1
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+0
-1
No files found.
app/controllers/application_controller.rb
View file @
fd166146
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
...
...
app/models/user.rb
View file @
fd166146
...
@@ -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
...
...
app/views/admin/users/_form.html.haml
View file @
fd166146
...
@@ -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
...
...
config/gitlab.yml.example
View file @
fd166146
...
@@ -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
...
...
config/initializers/1_settings.rb
View file @
fd166146
...
@@ -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
...
...
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