diff options
author | Rémy Coutable <remy@rymai.me> | 2016-06-01 18:17:03 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-06-14 13:07:26 +0200 |
commit | d75edf1a9854b2ab609c7d3acf5eee1ca89e8db9 (patch) | |
tree | f727b323c1ce9fd4419aea65c8c4aac4f07570b0 /app | |
parent | d71fbe0dbdb3b7aba6f71e6d3d50daaa890769e9 (diff) | |
download | gitlab-ce-d75edf1a9854b2ab609c7d3acf5eee1ca89e8db9.tar.gz |
Factorize access request routes into a new :access_requestable route concern
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/concerns/access_request_actions.rb | 2 | ||||
-rw-r--r-- | app/helpers/members_helper.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/concerns/access_request_actions.rb b/app/controllers/concerns/access_request_actions.rb index 1b0a1fe3081..c4d22749d6a 100644 --- a/app/controllers/concerns/access_request_actions.rb +++ b/app/controllers/concerns/access_request_actions.rb @@ -8,7 +8,7 @@ module AccessRequestActions notice: 'Your request for access has been queued for review.' end - def approve + def approve_access_request @member = access_requestable_resource.public_send(member_entity_name.pluralize).request.find(params[:id]) return render_403 unless can?(current_user, :"update_#{member_entity_name}", @member) diff --git a/app/helpers/members_helper.rb b/app/helpers/members_helper.rb index 6599c59d1c9..bd84b8b239f 100644 --- a/app/helpers/members_helper.rb +++ b/app/helpers/members_helper.rb @@ -53,9 +53,9 @@ module MembersHelper def approve_request_member_path(member) case member.source when Project - approve_namespace_project_project_member_path(member.source.namespace, member.source, member) + approve_access_request_namespace_project_project_member_path(member.source.namespace, member.source, member) when Group - approve_group_group_member_path(member.source, member) + approve_access_request_group_group_member_path(member.source, member) else raise ArgumentError.new('Unknown object class') end |