fix tempalte clone roles

This commit is contained in:
Pete Matsyburka
2024-09-26 22:12:58 +03:00
committed by Oleksandr Turchyn
parent c6b004f107
commit 0c039ee64f
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -116,7 +116,8 @@ class TemplatesController < ApplicationController
end
def authorized_clone_account_id?(account_id)
true_user.account_id.to_s == account_id.to_s || true_user.account.linked_accounts.exists?(id: account_id)
true_user.account_id.to_s == account_id.to_s ||
true_user.account.linked_accounts.accessible_by(current_ability).exists?(id: account_id)
end
def maybe_redirect_to_template(template)