Providers sharing (#1273)

* third party provider scoping

* Simplify logic and allow only admins to mange providers

* Broadcast fixes

* FIX tests and build

* Fixes

* Reviews

* Scope merchants

* DRY fixes
This commit is contained in:
soky srm
2026-03-25 17:47:04 +01:00
committed by GitHub
parent 1627cf197b
commit 9410e5b38d
74 changed files with 588 additions and 583 deletions

View File

@@ -16,15 +16,7 @@ class Transactions::BulkDeletionsController < ApplicationController
params.require(:bulk_delete).permit(entry_ids: [])
end
# Accounts where the user can delete entries (owner or full_control)
def writable_accounts
Current.family.accounts
.left_joins(:account_shares)
.where(
"accounts.owner_id = :uid OR (account_shares.user_id = :uid AND account_shares.permission = :perm)",
uid: Current.user.id,
perm: "full_control"
)
.distinct
Current.family.accounts.writable_by(Current.user)
end
end