From d48e5602ced3ecf71e07c74bb2878ad2b47fbf6f Mon Sep 17 00:00:00 2001 From: Sylvain Date: Tue, 22 Oct 2019 14:18:43 +0200 Subject: [PATCH] [bug] admins can't edit members projects --- CHANGELOG.md | 2 ++ app/assets/javascripts/controllers/projects.js.erb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 598207f52..df2a154bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog Fab Manager +- Fix a bug: admins can't edit members projects + ## v4.2.2 2019 October 22 - Fix a bug: PostgreSQL upgrade script won't run on some systems diff --git a/app/assets/javascripts/controllers/projects.js.erb b/app/assets/javascripts/controllers/projects.js.erb index b81d19648..ef6e88127 100644 --- a/app/assets/javascripts/controllers/projects.js.erb +++ b/app/assets/javascripts/controllers/projects.js.erb @@ -470,7 +470,7 @@ Application.Controllers.controller('EditProjectController', ['$rootScope', '$sco const initialize = function () { CSRF.setMetaTags(); - if ($scope.project.author_id !== $rootScope.currentUser.id && $scope.project.user_ids.indexOf($rootScope.currentUser.id) === -1) { + if ($scope.project.author_id !== $rootScope.currentUser.id && $scope.project.user_ids.indexOf($rootScope.currentUser.id) === -1 && $scope.currentUser.role !== 'admin') { $state.go('app.public.projects_show', { id: $scope.project.slug }); console.error('[EditProjectController::initialize] user is not allowed') }