From 5137a5b1a3c36e0b1b4a4e93ca4bcfca76c18383 Mon Sep 17 00:00:00 2001 From: Martin Artnik Date: Tue, 15 Jun 2021 13:16:51 +0200 Subject: [PATCH] Fix illegal return statement [SCI-5634] --- app/permissions/asset.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/permissions/asset.rb b/app/permissions/asset.rb index 01ab05ccb..f78262dbf 100644 --- a/app/permissions/asset.rb +++ b/app/permissions/asset.rb @@ -25,9 +25,11 @@ Canaid::Permissions.register_for(Asset) do when Result can_manage_result?(object) when RepositoryCell - return false if object.repository_column.repository.is_a?(RepositorySnapshot) - - can_manage_repository?(user, object.repository_column.repository) + if object.repository_column.repository.is_a?(RepositorySnapshot) + false + else + can_manage_repository?(user, object.repository_column.repository) + end end end end