summaryrefslogtreecommitdiff
path: root/app/views/shared
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-06-17 10:23:06 +0200
committerRémy Coutable <remy@rymai.me>2016-06-17 13:03:19 +0200
commitb2dc9176018729efc1969035b30017c2ed81a708 (patch)
tree7a87e5953bc9eca5586364c285e51dace8b23f02 /app/views/shared
parentf011b86beb89557afdaf2b0ec5ae904d0be237d8 (diff)
downloadgitlab-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.haml20
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'