Make membership required for create_user_by_membership
This commit is contained in:
parent
af129038e0
commit
d9d5600711
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue