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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
ce49f035
Commit
ce49f035
authored
Sep 15, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix access_level api
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
77c64a9b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
8 deletions
+11
-8
features/steps/project/team_management.rb
features/steps/project/team_management.rb
+2
-2
lib/api/entities.rb
lib/api/entities.rb
+5
-5
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+4
-1
No files found.
features/steps/project/team_management.rb
View file @
ce49f035
...
...
@@ -24,7 +24,7 @@ class ProjectTeamManagement < Spinach::FeatureSteps
select2
(
user
.
id
,
from:
"#user_ids"
,
multiple:
true
)
within
"#new_team_member"
do
select
"Reporter"
,
from:
"
project_access
"
select
"Reporter"
,
from:
"
access_level
"
end
click_button
"Add users"
end
...
...
@@ -44,7 +44,7 @@ class ProjectTeamManagement < Spinach::FeatureSteps
And
'I change "Sam" role to "Reporter"'
do
user
=
User
.
find_by
(
name:
"Sam"
)
within
"#user_
#{
user
.
id
}
"
do
select
"Reporter"
,
from:
"
team_member_project_access
"
select
"Reporter"
,
from:
"
project_member_access_level
"
end
end
...
...
lib/api/entities.rb
View file @
ce49f035
...
...
@@ -53,8 +53,8 @@ module API
end
class
ProjectMember
<
UserBasic
expose
:
project_access
,
as: :
access_level
do
|
user
,
options
|
options
[
:project
].
project_members
.
find_by
(
user_id:
user
.
id
).
project_access
expose
:access_level
do
|
user
,
options
|
options
[
:project
].
project_members
.
find_by
(
user_id:
user
.
id
).
access_level
end
end
...
...
@@ -67,7 +67,7 @@ module API
end
class
GroupMember
<
UserBasic
expose
:
group_access
,
as: :
access_level
do
|
user
,
options
|
expose
:access_level
do
|
user
,
options
|
options
[
:group
].
group_members
.
find_by
(
user_id:
user
.
id
).
group_access
end
end
...
...
@@ -170,12 +170,12 @@ module API
end
class
ProjectAccess
<
Grape
::
Entity
expose
:
project_access
,
as: :
access_level
expose
:access_level
expose
:notification_level
end
class
GroupAccess
<
Grape
::
Entity
expose
:
group_access
,
as: :
access_level
expose
:access_level
expose
:notification_level
end
...
...
spec/requests/api/projects_spec.rb
View file @
ce49f035
...
...
@@ -283,7 +283,10 @@ describe API::API, api: true do
describe
'permissions'
do
context
'personal project'
do
before
{
get
api
(
"/projects/
#{
project
.
id
}
"
,
user
)
}
before
do
project
.
team
<<
[
user
,
:master
]
get
api
(
"/projects/
#{
project
.
id
}
"
,
user
)
end
it
{
response
.
status
.
should
==
200
}
it
{
json_response
[
'permissions'
][
"project_access"
][
"access_level"
].
should
==
Gitlab
::
Access
::
MASTER
}
...
...
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