From 775a39344c7ba49ab2c3172f5767b607f61ce3d7 Mon Sep 17 00:00:00 2001 From: Jure Grabnar Date: Mon, 8 Aug 2016 13:40:08 +0200 Subject: [PATCH] Fix experiment archive permissions --- app/helpers/permission_helper.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/helpers/permission_helper.rb b/app/helpers/permission_helper.rb index 8bfc6009c..8cfa9c23c 100644 --- a/app/helpers/permission_helper.rb +++ b/app/helpers/permission_helper.rb @@ -274,11 +274,17 @@ module PermissionHelper end def can_archive_project(project) - is_owner_of_project(project) + is_owner_of_project(project) || + is_user_of_project(project) || + is_admin_of_organization(project.organization) end def can_restore_project(project) - project.archived? and is_owner_of_project(project) + project.archived? && ( + is_owner_of_project(project) || + is_user_of_project(project) || + is_admin_of_organization(project.organization) + ) end def can_add_user_to_project(project)