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
44b94f7c
Commit
44b94f7c
authored
Sep 29, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not show ldap users in add members dropdown.
parent
c7f610d7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
5 deletions
+12
-5
app/assets/javascripts/api.js.coffee
app/assets/javascripts/api.js.coffee
+2
-1
app/assets/javascripts/users_select.js.coffee
app/assets/javascripts/users_select.js.coffee
+3
-1
app/helpers/selects_helper.rb
app/helpers/selects_helper.rb
+1
-0
app/views/admin/groups/show.html.haml
app/views/admin/groups/show.html.haml
+1
-1
app/views/groups/_new_group_member.html.haml
app/views/groups/_new_group_member.html.haml
+1
-1
app/views/projects/team_members/_form.html.haml
app/views/projects/team_members/_form.html.haml
+1
-1
lib/api/users.rb
lib/api/users.rb
+3
-0
No files found.
app/assets/javascripts/api.js.coffee
View file @
44b94f7c
...
...
@@ -38,7 +38,7 @@
# Return users list. Filtered by query
# Only active users retrieved
users
:
(
query
,
callback
)
->
users
:
(
query
,
skip_ldap
,
callback
)
->
url
=
Api
.
buildUrl
(
Api
.
users_path
)
$
.
ajax
(
...
...
@@ -48,6 +48,7 @@
search
:
query
per_page
:
20
active
:
true
skip_ldap
:
skip_ldap
dataType
:
"json"
).
done
(
users
)
->
callback
(
users
)
...
...
app/assets/javascripts/users_select.js.coffee
View file @
44b94f7c
...
...
@@ -15,12 +15,14 @@ $ ->
user
.
name
$
(
'.ajax-users-select'
).
each
(
i
,
select
)
->
skip_ldap
=
$
(
select
).
hasClass
(
'skip_ldap'
)
$
(
select
).
select2
placeholder
:
"Search for a user"
multiple
:
$
(
select
).
hasClass
(
'multiselect'
)
minimumInputLength
:
0
query
:
(
query
)
->
Api
.
users
query
.
term
,
(
users
)
->
Api
.
users
query
.
term
,
skip_ldap
,
(
users
)
->
data
=
{
results
:
users
}
query
.
callback
(
data
)
...
...
app/helpers/selects_helper.rb
View file @
44b94f7c
...
...
@@ -2,6 +2,7 @@ module SelectsHelper
def
users_select_tag
(
id
,
opts
=
{})
css_class
=
"ajax-users-select "
css_class
<<
"multiselect "
if
opts
[
:multiple
]
css_class
<<
"skip_ldap "
if
opts
[
:skip_ldap
]
css_class
<<
(
opts
[
:class
]
||
''
)
value
=
opts
[
:selected
]
||
''
...
...
app/views/admin/groups/show.html.haml
View file @
44b94f7c
...
...
@@ -87,7 +87,7 @@
=
form_tag
project_teams_update_admin_group_path
(
@group
),
id:
"new_team_member"
,
class:
"bulk_import"
,
method: :put
do
%div
=
users_select_tag
(
:user_ids
,
multiple:
true
)
=
users_select_tag
(
:user_ids
,
{
multiple:
true
,
skip_ldap:
true
}
)
%div
.prepend-top-10
=
select_tag
:group_access
,
options_for_select
(
UsersGroup
.
group_access_roles
),
class:
"project-access-select select2"
%hr
...
...
app/views/groups/_new_group_member.html.haml
View file @
44b94f7c
=
form_for
@users_group
,
url:
group_users_groups_path
(
@group
),
html:
{
class:
'form-horizontal users-group-form'
}
do
|
f
|
.form-group
=
f
.
label
:user_ids
,
"People"
,
class:
'control-label'
.col-sm-10
=
users_select_tag
(
:user_ids
,
multiple:
true
,
class:
'input-large'
)
.col-sm-10
=
users_select_tag
(
:user_ids
,
{
multiple:
true
,
skip_ldap:
true
,
class:
'input-large'
}
)
.form-group
=
f
.
label
:group_access
,
"Group Access"
,
class:
'control-label'
...
...
app/views/projects/team_members/_form.html.haml
View file @
44b94f7c
...
...
@@ -12,7 +12,7 @@
.form-group
=
f
.
label
:user_ids
,
"People"
,
class:
'control-label'
.col-sm-10
=
users_select_tag
(
:user_ids
,
multiple:
true
)
=
users_select_tag
(
:user_ids
,
{
multiple:
true
,
skip_ldap:
true
}
)
%p
2. Set access level for them
.form-group
...
...
lib/api/users.rb
View file @
44b94f7c
...
...
@@ -9,8 +9,11 @@ module API
# Example Request:
# GET /users
get
do
skip_ldap
=
params
[
:skip_ldap
].
present?
&&
params
[
:skip_ldap
]
==
'true'
@users
=
User
.
all
@users
=
@users
.
active
if
params
[
:active
].
present?
@users
=
@users
.
where
(
'provider != ? OR provider IS NULL'
,
'ldap'
)
if
skip_ldap
@users
=
@users
.
search
(
params
[
:search
])
if
params
[
:search
].
present?
@users
=
paginate
@users
...
...
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