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
d0ba5e4b
Commit
d0ba5e4b
authored
Feb 06, 2017
by
Timothy Andrew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the auditor user UI more compatible with GitLab CE.
Use partials and backport code where necessary.
parent
67666a3c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
48 deletions
+49
-48
app/controllers/admin/users_controller.rb
app/controllers/admin/users_controller.rb
+1
-0
app/models/user.rb
app/models/user.rb
+0
-4
app/views/admin/users/_access_levels_ee.html.haml
app/views/admin/users/_access_levels_ee.html.haml
+44
-0
app/views/admin/users/_form.html.haml
app/views/admin/users/_form.html.haml
+1
-42
spec/features/admin/admin_users_spec.rb
spec/features/admin/admin_users_spec.rb
+3
-2
No files found.
app/controllers/admin/users_controller.rb
View file @
d0ba5e4b
...
...
@@ -175,6 +175,7 @@ class Admin::UsersController < Admin::ApplicationController
def
user_params_ce
[
:admin
,
:avatar
,
:bio
,
:can_create_group
,
...
...
app/models/user.rb
View file @
d0ba5e4b
...
...
@@ -533,10 +533,6 @@ class User < ActiveRecord::Base
admin
end
def
is_auditor?
auditor
end
def
require_ssh_key?
keys
.
count
==
0
&&
Gitlab
::
ProtocolAccess
.
allowed?
(
'ssh'
)
end
...
...
app/views/admin/users/_access_levels_ee.html.haml
0 → 100644
View file @
d0ba5e4b
%fieldset
%legend
Access
.form-group
=
f
.
label
:projects_limit
,
class:
'control-label'
.col-sm-10
=
f
.
number_field
:projects_limit
,
min:
0
,
class:
'form-control'
.form-group
=
f
.
label
:can_create_group
,
class:
'control-label'
.col-sm-10
=
f
.
check_box
:can_create_group
.form-group
=
f
.
label
:admin
,
class:
'control-label'
.col-sm-10
=
f
.
radio_button
:access_level
,
:regular
,
checked:
true
=
label_tag
:regular
do
Regular
%p
.light
Regular users have access to their groups and projects
-
if
license_allows_auditor_user?
=
f
.
radio_button
:access_level
,
:auditor
=
label_tag
:auditor
do
Audit
%p
.light
Auditors have read-only access to all groups, projects and users
-
if
current_user
==
@user
=
f
.
radio_button
:access_level
,
:admin
=
label_tag
:admin
do
Admin
%p
.light
You cannot remove your own admin rights
-
else
=
f
.
radio_button
:access_level
,
:admin
=
label_tag
:admin
do
Admin
%p
.light
Administrators have access to all groups, projects and users and can manage all features in this installation
.form-group
=
f
.
label
:external
,
class:
'control-label'
.col-sm-10
=
f
.
check_box
:external
do
External
%p
.light
External users cannot see internal or private projects unless access is explicitly granted. Also, external users cannot create projects or groups.
app/views/admin/users/_form.html.haml
View file @
d0ba5e4b
...
...
@@ -40,49 +40,8 @@
=
f
.
label
:password_confirmation
,
class:
'control-label'
.col-sm-10
=
f
.
password_field
:password_confirmation
,
disabled:
f
.
object
.
force_random_password
,
class:
'form-control'
%fieldset
%legend
Access
.form-group
=
f
.
label
:projects_limit
,
class:
'control-label'
.col-sm-10
=
f
.
number_field
:projects_limit
,
min:
0
,
class:
'form-control'
.form-group
=
f
.
label
:can_create_group
,
class:
'control-label'
.col-sm-10
=
f
.
check_box
:can_create_group
=
render
partial:
'access_levels_ee'
,
locals:
{
f:
f
}
.form-group
=
f
.
label
:admin
,
class:
'control-label'
.col-sm-10
=
f
.
radio_button
:access_level
,
:regular
,
checked:
true
=
label_tag
:regular
do
Regular
%p
.light
Regular users have access to their groups and projects
-
if
license_allows_auditor_user?
=
f
.
radio_button
:access_level
,
:auditor
=
label_tag
:auditor
do
Audit
%p
.light
Auditors have read-only access to all groups, projects and users
-
if
current_user
==
@user
=
f
.
radio_button
:access_level
,
:admin
=
label_tag
:admin
do
Admin
%p
.light
You cannot remove your own admin rights
-
else
=
f
.
radio_button
:access_level
,
:admin
=
label_tag
:admin
do
Admin
%p
.light
Administrators have access to all groups, projects and users and can manage all features in this installation
.form-group
=
f
.
label
:external
,
class:
'control-label'
.col-sm-10
=
f
.
check_box
:external
do
External
%p
.light
External users cannot see internal or private projects unless access is explicitly granted. Also, external users cannot create projects or groups.
%fieldset
%legend
Profile
.form-group
...
...
spec/features/admin/admin_users_spec.rb
View file @
d0ba5e4b
...
...
@@ -237,8 +237,9 @@ describe "Admin::Users", feature: true do
it
"changes account type to be auditor"
do
user
.
reload
expect
(
user
.
is_admin?
).
to
be_falsey
expect
(
user
.
is_auditor?
).
to
be_truthy
expect
(
user
).
not_to
be_admin
expect
(
user
).
to
be_auditor
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