mirror of
https://github.com/we-promise/sure.git
synced 2026-04-25 23:14:10 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user