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
d9d56007
Commit
d9d56007
authored
Jun 28, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make membership required for create_user_by_membership
parent
af129038
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
spec/support/matchers/access_matchers_for_controller.rb
spec/support/matchers/access_matchers_for_controller.rb
+3
-3
No files found.
spec/support/matchers/access_matchers_for_controller.rb
View file @
d9d56007
...
@@ -25,6 +25,8 @@ module AccessMatchersForController
...
@@ -25,6 +25,8 @@ module AccessMatchersForController
user
=
role
user
=
role
sign_in
(
user
)
sign_in
(
user
)
when
*
Gitlab
::
Access
.
sym_options_with_owner
.
keys
# owner, master, developer, reporter, guest
when
*
Gitlab
::
Access
.
sym_options_with_owner
.
keys
# owner, master, developer, reporter, guest
raise
ArgumentError
,
"cannot emulate
#{
role
}
without membership parent"
unless
membership
user
=
create_user_by_membership
(
role
,
membership
)
user
=
create_user_by_membership
(
role
,
membership
)
sign_in
(
user
)
sign_in
(
user
)
else
else
...
@@ -34,9 +36,7 @@ module AccessMatchersForController
...
@@ -34,9 +36,7 @@ module AccessMatchersForController
user
user
end
end
def
create_user_by_membership
(
role
,
membership
=
nil
)
def
create_user_by_membership
(
role
,
membership
)
raise
ArgumentError
,
"cannot emulate
#{
role
}
without membership parent"
unless
membership
if
role
==
:owner
&&
membership
.
owner
if
role
==
:owner
&&
membership
.
owner
user
=
membership
.
owner
user
=
membership
.
owner
else
else
...
...
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