diff options
author | Rémy Coutable <remy@rymai.me> | 2016-06-17 10:23:06 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-06-17 13:03:19 +0200 |
commit | b2dc9176018729efc1969035b30017c2ed81a708 (patch) | |
tree | 7a87e5953bc9eca5586364c285e51dace8b23f02 /app/views/shared | |
parent | f011b86beb89557afdaf2b0ec5ae904d0be237d8 (diff) | |
download | gitlab-ce-b2dc9176018729efc1969035b30017c2ed81a708.tar.gz |
Group owner cannot request access to a project of their group
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/views/shared')
-rw-r--r-- | app/views/shared/members/_access_request_buttons.html.haml | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/app/views/shared/members/_access_request_buttons.html.haml b/app/views/shared/members/_access_request_buttons.html.haml index ed0a6ebcf84..e0fc9f7af37 100644 --- a/app/views/shared/members/_access_request_buttons.html.haml +++ b/app/views/shared/members/_access_request_buttons.html.haml @@ -1,12 +1,14 @@ - member = source.members.find_by(user_id: current_user.id) +- group_member = source.group.members.find_by(user_id: current_user.id) if source.try(:group) -- if member - - if member.request? - = link_to 'Withdraw Access Request', polymorphic_path([:leave, source, :members]), - method: :delete, - data: { confirm: remove_member_message(member) }, +- unless group_member + - if member + - if member.request? + = link_to 'Withdraw Access Request', polymorphic_path([:leave, source, :members]), + method: :delete, + data: { confirm: remove_member_message(member) }, + class: 'btn access-request-button hidden-xs' + - else + = link_to 'Request Access', polymorphic_path([:request_access, source, :members]), + method: :post, class: 'btn access-request-button hidden-xs' -- else - = link_to 'Request Access', polymorphic_path([:request_access, source, :members]), - method: :post, - class: 'btn access-request-button hidden-xs' |