Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
3895e547
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3895e547
编写于
5月 28, 2019
作者:
I
Imre Farkas
提交者:
Yorick Peterse
5月 28, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
CE port of Move EE specific lines in API::Users
上级
9c2d0d87
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
32 addition
and
8 deletion
+32
-8
lib/api/helpers/users_helpers.rb
lib/api/helpers/users_helpers.rb
+16
-0
lib/api/users.rb
lib/api/users.rb
+4
-8
spec/requests/api/users_spec.rb
spec/requests/api/users_spec.rb
+12
-0
未找到文件。
lib/api/helpers/users_helpers.rb
0 → 100644
浏览文件 @
3895e547
# frozen_string_literal: true
module
API
module
Helpers
module
UsersHelpers
extend
ActiveSupport
::
Concern
extend
Grape
::
API
::
Helpers
params
:optional_params_ee
do
end
params
:optional_index_params_ee
do
end
end
end
end
lib/api/users.rb
浏览文件 @
3895e547
...
...
@@ -15,6 +15,8 @@ module API
authenticate_non_get!
end
helpers
Helpers
::
UsersHelpers
helpers
do
# rubocop: disable CodeReuse/ActiveRecord
def
find_user_by_id
(
params
)
...
...
@@ -52,10 +54,7 @@ module API
optional
:private_profile
,
type:
Boolean
,
desc:
'Flag indicating the user has a private profile'
all_or_none_of
:extern_uid
,
:provider
if
Gitlab
.
ee?
optional
:shared_runners_minutes_limit
,
type:
Integer
,
desc:
'Pipeline minutes quota for this user'
optional
:extra_shared_runners_minutes_limit
,
type:
Integer
,
desc:
'(admin-only) Extra pipeline minutes quota for this user'
end
use
:optional_params_ee
end
params
:sort_params
do
...
...
@@ -85,10 +84,7 @@ module API
use
:sort_params
use
:pagination
use
:with_custom_attributes
if
Gitlab
.
ee?
optional
:skip_ldap
,
type:
Boolean
,
default:
false
,
desc:
'Skip LDAP users'
end
use
:optional_index_params_ee
end
# rubocop: disable CodeReuse/ActiveRecord
get
do
...
...
spec/requests/api/users_spec.rb
浏览文件 @
3895e547
...
...
@@ -276,6 +276,18 @@ describe API::Users do
expect
(
response
).
to
have_gitlab_http_status
(
400
)
end
end
context
"when authenticated and ldap is enabled"
do
it
"returns non-ldap user"
do
create
:omniauth_user
,
provider:
"ldapserver1"
get
api
(
"/users"
,
user
),
params:
{
skip_ldap:
"true"
}
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
.
first
[
"username"
]).
to
eq
user
.
username
end
end
end
describe
"GET /users/:id"
do
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录