From 940469e41b7d781f28fc19cb35ac5c3df67a1bf0 Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Fri, 9 Mar 2018 12:08:34 +0100 Subject: [PATCH] Fix user management on project [SCI-2146] --- app/controllers/user_projects_controller.rb | 4 ++-- app/views/user_projects/_index_edit_footer.html.erb | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/controllers/user_projects_controller.rb b/app/controllers/user_projects_controller.rb index 507c98da2..a64fb52af 100644 --- a/app/controllers/user_projects_controller.rb +++ b/app/controllers/user_projects_controller.rb @@ -191,8 +191,8 @@ class UserProjectsController < ApplicationController end def check_manage_permisisons - render_403 unless can_manage_project?(@project) && - params[:id] == current_user.id + render_403 unless can_manage_project?(@project) || + params[:id] != current_user.id end def init_gui diff --git a/app/views/user_projects/_index_edit_footer.html.erb b/app/views/user_projects/_index_edit_footer.html.erb index 8dbe3ddb7..cd76a65f2 100644 --- a/app/views/user_projects/_index_edit_footer.html.erb +++ b/app/views/user_projects/_index_edit_footer.html.erb @@ -1,9 +1,7 @@ <% if current_user.is_admin_of_team?(@project.team) %> - <%= link_to t('projects.index.modal_manage_users.invite_users_link'), - "/settings/teams/#{@project.team.id}", - data: { turbolinks: false } %> + <%= link_to t('projects.index.modal_manage_users.invite_users_link'), team_path(@project.team.id) %> <%=t 'projects.index.modal_manage_users.invite_users_details', team: @project.team.name %> <% else %> <%=t 'projects.index.modal_manage_users.contact_admins', team: @project.team.name %>