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
Jérome Perrin
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
Hide 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
user
=
role
sign_in
(
user
)
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
)
sign_in
(
user
)
else
...
...
@@ -34,9 +36,7 @@ module AccessMatchersForController
user
end
def
create_user_by_membership
(
role
,
membership
=
nil
)
raise
ArgumentError
,
"cannot emulate
#{
role
}
without membership parent"
unless
membership
def
create_user_by_membership
(
role
,
membership
)
if
role
==
:owner
&&
membership
.
owner
user
=
membership
.
owner
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