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
3d14cd02
Commit
3d14cd02
authored
Jun 28, 2017
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Present "plan" data for group/namespace admins
parent
c49b3f5f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
4 deletions
+5
-4
doc/api/namespaces.md
doc/api/namespaces.md
+3
-2
lib/api/entities.rb
lib/api/entities.rb
+1
-1
spec/requests/api/namespaces_spec.rb
spec/requests/api/namespaces_spec.rb
+1
-1
No files found.
doc/api/namespaces.md
View file @
3d14cd02
...
...
@@ -38,7 +38,8 @@ Example response:
"kind"
:
"group"
"full_path"
:
"group1"
,
"parent_id"
:
"null"
,
"members_count_with_descendants"
:
2
"members_count_with_descendants"
:
2
,
"plan"
:
"bronze"
},
{
"id"
:
3
,
...
...
@@ -51,7 +52,7 @@ Example response:
]
```
**Note**
:
`members_count_with_descendants`
are presented only for group masters/owners.
**Note**
:
`members_count_with_descendants`
a
nd
`plan`
a
re presented only for group masters/owners.
## Search for namespace
...
...
lib/api/entities.rb
View file @
3d14cd02
...
...
@@ -522,7 +522,7 @@ module API
# EE-only
expose
:shared_runners_minutes_limit
,
if:
lambda
{
|
_
,
options
|
options
[
:current_user
]
&
.
admin?
}
expose
:plan
,
if:
lambda
{
|
_
,
options
|
options
[
:current_user
]
&
.
admin?
}
expose
:plan
,
if:
->
(
namespace
,
opts
)
{
Ability
.
allowed?
(
opts
[
:current_user
],
:admin_namespace
,
namespace
)
}
end
class
MemberAccess
<
Grape
::
Entity
...
...
spec/requests/api/namespaces_spec.rb
View file @
3d14cd02
...
...
@@ -61,7 +61,7 @@ describe API::Namespaces do
owned_group_response
=
json_response
.
find
{
|
resource
|
resource
[
'id'
]
==
group1
.
id
}
expect
(
owned_group_response
.
keys
).
to
contain_exactly
(
'id'
,
'kind'
,
'name'
,
'path'
,
'full_path'
,
'parent_id'
,
'members_count_with_descendants'
)
'p
lan'
,
'p
arent_id'
,
'members_count_with_descendants'
)
end
it
"returns correct attributes when user cannot admin group"
do
...
...
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