opencollective / opencollective

We're tracking all our Issues, RFCs and a few other documents in this repository.
https://opencollective.com
MIT License
2k stars 365 forks source link

Make it clear admin may not have invited expense #5445

Open alanna opened 2 years ago

alanna commented 2 years ago

It seems anyone can invite an expense from any Collective by default. This is a way for a random person to trigger an email that looks like it's been officially approved by the Collective. I think it makes more sense for only admins to be able to invite expenses for that Collective.

See https://opencollective.slack.com/archives/G46PNRCGP/p1650062399578029?thread_ts=1650062399.578029&cid=G46PNRCGP

Betree commented 1 year ago

I agree with this one, I would however relax the rule to allow host admins to invite people to submit expenses for the collectives they're hosting.

Betree commented 1 year ago

I've looked into this, but it looks like there are many legit cases of non-admins inviting people to submit expenses. I've used this query which only looks at paid expenses:

select uc.slug as inviter, 'https://opencollective.com/' || c.slug || '/expenses/' || e.id as expense
from "Expenses" e
INNER JOIN "Collectives" c ON c.id = e."CollectiveId"
LEFT JOIN "Collectives" parent ON c."ParentCollectiveId" = parent.id
INNER JOIN "Collectives" uc ON uc.id = (e.data #>> '{invitedByCollectiveId}')::integer
LEFT JOIN "Members" m
  ON m."MemberCollectiveId" = uc.id
 AND (m.role = 'ADMIN' OR m.role = 'MEMBER')
 AND (m."CollectiveId" = c.id OR m."CollectiveId" = c."HostCollectiveId" OR m."CollectiveId" = parent.id)
WHERE  e.data #>> '{invitedByCollectiveId}' IS NOT NULL
AND c."isActive" IS TRUE
AND e.status = 'PAID'
AND m.id IS NULL

Which gives these 232 rows:

inviter expense
hodierne-ventures https://opencollective.com/engineering/expenses/90574
christine-gray https://opencollective.com/arthurs-hill-solidarity-fund/expenses/42976
brittany2 https://opencollective.com/athensmutualaidnetwork/expenses/89007
abs-shalom https://opencollective.com/transaidcymru/expenses/93290
gregoire-fischer https://opencollective.com/codenplay/expenses/84227
sarah-schulz https://opencollective.com/y-collective/expenses/58661
minn https://opencollective.com/java-jda/expenses/100052
matthew-painton https://opencollective.com/deep-adaptation-forum/expenses/112239
openmike https://opencollective.com/regional-retreats-jan-2021-91d34198/expenses/62180
viridiana-preciado https://opencollective.com/aorhf/expenses/103746
anastasia-mayzhegisheva https://opencollective.com/synfig-ru/expenses/99736
anastasia-nelyubina https://opencollective.com/synfig-ru/expenses/99737
maddie-stardust https://opencollective.com/metagov/expenses/95692
anastasia-nelyubina https://opencollective.com/synfig-ru/expenses/102886
ellie1 https://opencollective.com/she256_/expenses/48556
rin-burton https://opencollective.com/transaidcymru/expenses/55433
brenda-baker https://opencollective.com/fridays-for-future-nyc/expenses/50240
foundation https://opencollective.com/data-umbrella/expenses/110420
foundation https://opencollective.com/nmhep/expenses/110422
foundation https://opencollective.com/peoples-utility/expenses/110423
black-math https://opencollective.com/engineering/expenses/75367
anastasia-mayzhegisheva https://opencollective.com/synfig-ru/expenses/102885
jermorris https://opencollective.com/athensmutualaidnetwork/expenses/88836
zoe-fox https://opencollective.com/bronzeville-kenwood-ma/expenses/63011
foundation https://opencollective.com/pgchangemakers/expenses/110424
foundation https://opencollective.com/sovereign-bodies-institute/expenses/110425
hodierne-ventures https://opencollective.com/engineering/expenses/82609
shaunab https://opencollective.com/regens-unite-berlin-32d88c5e/expenses/99779
shaunab https://opencollective.com/regens-unite-berlin-32d88c5e/expenses/99778
haidee-dampney1 https://opencollective.com/250-pop/expenses/51985
lucy-rix https://opencollective.com/schoolsabc/expenses/36696
terese-jonsson https://opencollective.com/schoolsabc/expenses/35879
terese-jonsson https://opencollective.com/schoolsabc/expenses/35876
ayomide-o-oluyemi https://opencollective.com/schoolsabc/expenses/36187
rastafari-food-and-wellbeing https://opencollective.com/lambethmutualaid/expenses/31878
sarah-hop https://opencollective.com/schoolsabc/expenses/36912
olubukola https://opencollective.com/se15-community-fund/expenses/104980
tara-williams1 https://opencollective.com/transaidcymru/expenses/90327
extinction-rebellion-namur https://opencollective.com/xr-belgium/expenses/54136
luis-camacho https://opencollective.com/decrescimento-pt/expenses/55149
cathy-jackson https://opencollective.com/beestonmutualaid/expenses/83191
rae-w https://opencollective.com/arthurs-hill-solidarity-fund/expenses/52022
hodierne-ventures https://opencollective.com/engineering/expenses/86696
kei https://opencollective.com/transaidcymru/expenses/108718
george-peter-banyard https://opencollective.com/phpfoundation/expenses/109672
tatiana-los https://opencollective.com/kensal-green-mutual-aid/expenses/66557
vegetal-anarca https://opencollective.com/climaximopt/expenses/91595
zig-fisher https://opencollective.com/openipc/expenses/47162
black-math https://opencollective.com/engineering/expenses/110417
black-math https://opencollective.com/engineering/expenses/99294
tina-clark https://opencollective.com/arthurs-hill-solidarity-fund/expenses/49766
opensource https://opencollective.com/di-coordination/expenses/99734
tina-clark https://opencollective.com/arthurs-hill-solidarity-fund/expenses/52001
joao-cardoso1 https://opencollective.com/storybook/expenses/45678
foundation https://opencollective.com/change-waco/expenses/110419
justworks https://opencollective.com/opensource/expenses/110540
nila-fortunr https://opencollective.com/westbrooklynwaterfrontmutualaid/expenses/63438
abie-walker1 https://opencollective.com/arthurs-hill-solidarity-fund/expenses/52707
sandra-esi-abban https://opencollective.com/newhamsolidarityfund/expenses/52806
afsha-hussain https://opencollective.com/newhamsolidarityfund/expenses/109906
brianna-balenciaga https://opencollective.com/nojusticenopride/expenses/62509
bola-ajose https://opencollective.com/ambassadors-budget/expenses/50512
bola-ajose https://opencollective.com/ambassadors-budget/expenses/50511
bola-ajose https://opencollective.com/ambassadors-budget/expenses/50509
martina-smith https://opencollective.com/se15-community-fund/expenses/101498
motoharu-kinoshita https://opencollective.com/quantecon-schwab-charitable/expenses/104304
hodierne-ventures https://opencollective.com/engineering/expenses/95423
michael-damman https://opencollective.com/agora/expenses/78757
turnip https://opencollective.com/mpls-northside-mutual-aid/expenses/64255
abs-shalom https://opencollective.com/transaidcymru/expenses/106316
matthew-rundquist https://opencollective.com/lsrsn/expenses/107850
cathy-jackson https://opencollective.com/beestonmutualaid/expenses/83214
black-math https://opencollective.com/engineering/expenses/85000
guest-7b1d1bc2 https://opencollective.com/stapleford-mutual-aid/expenses/64576
asha-mackay https://opencollective.com/swma_nyc/expenses/79421
matthew-sedman https://opencollective.com/hullroundheads/expenses/60406
harry-twohig https://opencollective.com/ambassadors-budget/expenses/92394
shaunab https://opencollective.com/regens-unite-berlin-32d88c5e/expenses/98363
shaunab https://opencollective.com/regens-unite-berlin-32d88c5e/expenses/98361
desiyah1 https://opencollective.com/athensmutualaidnetwork/expenses/78883
protozoa https://opencollective.com/opencollective/expenses/91956
shaunab https://opencollective.com/regens-unite-berlin-32d88c5e/expenses/98357
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/109627
fisker https://opencollective.com/prettier/expenses/92477
black-math https://opencollective.com/engineering/expenses/80309
jermorris https://opencollective.com/athensmutualaidnetwork/expenses/84112
charline-winston https://opencollective.com/arthurs-hill-solidarity-fund/expenses/78710
charline-winston https://opencollective.com/arthurs-hill-solidarity-fund/expenses/78987
elena-de-las-heras-lopez https://opencollective.com/speak-brussels/expenses/75543
sophia-dalonzo https://opencollective.com/pgchangemakers/expenses/89140
anastasia-mayzhegisheva https://opencollective.com/synfig-ru/expenses/106139
michael-damman https://opencollective.com/agora/expenses/90193
olubukola https://opencollective.com/se15-community-fund/expenses/98946
anastasia-nelyubina https://opencollective.com/synfig-ru/expenses/106140
z-birrell https://opencollective.com/transaidcymru/expenses/90411
igniter-labs https://opencollective.com/tastyigniter/expenses/90329
nikolaj-katballe https://opencollective.com/the-borderland-2022/expenses/90993
olubukola https://opencollective.com/se15-community-fund/expenses/92681
jacob10 https://opencollective.com/transaidcymru/expenses/88677
sarah-brook https://opencollective.com/together-with-afghans/expenses/91454
minn https://opencollective.com/java-jda/expenses/93177
opensource https://opencollective.com/sustain-general-support-grant/expenses/99735
justworks https://opencollective.com/foundation/expenses/110418
black-math https://opencollective.com/engineering/expenses/92850
heather-bhandari https://opencollective.com/online-learning-modules/expenses/101253
shaunab https://opencollective.com/regens-unite-berlin-32d88c5e/expenses/99780
shaunab https://opencollective.com/regens-unite-berlin-32d88c5e/expenses/99777
lisa-martin https://opencollective.com/zarr-czi-2021-237467/expenses/84573
gemma-jones https://opencollective.com/transaidcymru/expenses/100663
black-math https://opencollective.com/engineering/expenses/88862
leslie4 https://opencollective.com/food4life/expenses/95895
leslie4 https://opencollective.com/food4life/expenses/93988
rian-agnew https://opencollective.com/transaidcymru/expenses/97890
max-middlemist https://opencollective.com/ward-5-mutual-aid/expenses/93882
jaz-millar https://opencollective.com/transaidcymru/expenses/87417
enrico-ghiani https://opencollective.com/transaidcymru/expenses/101251
mason-manley https://opencollective.com/fridaysforfuture-us/expenses/98384
shaunab https://opencollective.com/regens-unite-berlin-32d88c5e/expenses/99775
protozoa https://opencollective.com/opencollective/expenses/87918
sarah-brook https://opencollective.com/together-with-afghans/expenses/87844
satyam-bholah1 https://opencollective.com/newhamsolidarityfund/expenses/104978
akanisi-tupou https://opencollective.com/se15-community-fund/expenses/99158
kyrie-williams https://opencollective.com/transaidcymru/expenses/107317
fisker https://opencollective.com/prettier/expenses/88429
abi4 https://opencollective.com/mpls-northside-mutual-aid/expenses/100721
parinama-krama https://opencollective.com/opensource/expenses/92679
opensource https://opencollective.com/sustain-general-support-grant/expenses/99297
lisa-marie-klein https://opencollective.com/rail-to-the-cop/expenses/51888
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/106811
sherene-m https://opencollective.com/arthurs-hill-solidarity-fund/expenses/52369
extinction-rebellion-namur https://opencollective.com/xr-belgium/expenses/52639
ciera-martinez1 https://opencollective.com/data-science-by-design/expenses/41399
victoria10 https://opencollective.com/tpf/expenses/115346
chloe-palmer https://opencollective.com/newhamsolidarityfund/expenses/35223
chloe-palmer1 https://opencollective.com/newhamsolidarityfund/expenses/35732
susanne-daswani https://opencollective.com/newhamsolidarityfund/expenses/35683
user-678de058 https://opencollective.com/kandc-mutual-aid-uk/expenses/39930
admin-duopo https://opencollective.com/duopo/expenses/39513
angela-blackett https://opencollective.com/arthurs-hill-solidarity-fund/expenses/29236
chris-croome https://opencollective.com/meet-coop/expenses/30505
chris-croome https://opencollective.com/meet-coop/expenses/30506
margaret-hill https://opencollective.com/street-forum/expenses/36218
susanne-daswani https://opencollective.com/newhamsolidarityfund/expenses/37898
nila-fortunr https://opencollective.com/westbrooklynwaterfrontmutualaid/expenses/33897
c-a https://opencollective.com/newhamsolidarityfund/expenses/107398
sabine-moore https://opencollective.com/collective-y/expenses/105665
protozoa https://opencollective.com/foundation/expenses/98948
victoria10 https://opencollective.com/tpf/expenses/115358
foundation https://opencollective.com/opencollective/expenses/100574
s-ellis https://opencollective.com/se15-community-fund/expenses/104982
sofie-castro-de-freitas https://opencollective.com/se15-community-fund/expenses/104984
viridiana-preciado https://opencollective.com/aorhf/expenses/101561
igniter-labs https://opencollective.com/tastyigniter/expenses/101785
igniter-labs https://opencollective.com/tastyigniter/expenses/94713
erin-m1 https://opencollective.com/freefoodcollective/expenses/101983
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/104670
foundation https://opencollective.com/spec/expenses/105312
foundation https://opencollective.com/art_coop/expenses/105315
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/109451
imani-scott-blackwell https://opencollective.com/ahat/expenses/103144
gemma-jones https://opencollective.com/transaidcymru/expenses/106842
cesakparis https://opencollective.com/cesakparis/expenses/106846
zak3 https://opencollective.com/frais-davocats-4f2840c4/expenses/106271
jacob10 https://opencollective.com/transaidcymru/expenses/103201
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/107103
minn https://opencollective.com/java-jda/expenses/106231
black-math https://opencollective.com/engineering/expenses/105601
matthew-rundquist https://opencollective.com/lsrsn/expenses/107891
protozoa https://opencollective.com/foundation/expenses/104977
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/109629
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/107087
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/108036
george-peter-banyard https://opencollective.com/phpfoundation/expenses/104587
jennifer-reynolds https://opencollective.com/transaidcymru/expenses/107548
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/107078
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/107079
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/106810
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/107088
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/109453
viridiana-preciado https://opencollective.com/aorhf/expenses/107619
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/106805
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/106807
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/106809
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/106806
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/107274
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/106802
viridiana-preciado https://opencollective.com/aorhf/expenses/108175
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/112827
protozoa https://opencollective.com/opencollective/expenses/109254
ferret1 https://opencollective.com/phones/expenses/105814
heather-bhandari https://opencollective.com/online-learning-modules/expenses/107320
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/108035
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/109843
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/109849
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/109848
asticot https://opencollective.com/xr-reunion/expenses/111036
protozoa https://opencollective.com/opencollective/expenses/97888
protozoa https://opencollective.com/opencollective/expenses/104119
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/106803
matthew-rundquist https://opencollective.com/lsrsn/expenses/108322
asticot https://opencollective.com/xr-reunion/expenses/111040
viridiana-preciado https://opencollective.com/aorhf/expenses/113948
colleen-and-joe-bottigliero https://opencollective.com/ukvma/expenses/114715
colleen-and-joe-bottigliero https://opencollective.com/ukvma/expenses/114717
ren-luna-branagan https://opencollective.com/transaidcymru/expenses/108556
dylan-hrebenach https://opencollective.com/openmined/expenses/109256
opensource https://opencollective.com/di-coordination/expenses/110543
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/115578
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/109625
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/109628
kathryn-radovan https://opencollective.com/thecodebarbarian/expenses/109477
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/109851
tiwaiwaka https://opencollective.com/tiwaiwakanz/expenses/109257
protozoa https://opencollective.com/foundation/expenses/109888
foundation https://opencollective.com/opencollective/expenses/110426
mike-benson1 https://opencollective.com/together-with-young-people/expenses/110908
general-intellect-sl https://opencollective.com/opencollective/expenses/115792
minn https://opencollective.com/java-jda/expenses/110906
foundation https://opencollective.com/julian-collective/expenses/110421
faye-tolland https://opencollective.com/nunhead-knocks/expenses/113573
rebeca-rad-pereira-radoszkowicz https://opencollective.com/foundation/expenses/108204
sabine-moore https://opencollective.com/collective-y/expenses/115533
heather-bhandari https://opencollective.com/online-learning-modules/expenses/112714
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/109846
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/114040
viridiana-preciado https://opencollective.com/sovereign-bodies-institute/expenses/114039
colleen-and-joe-bottigliero https://opencollective.com/ukvma/expenses/114719
colleen-and-joe-bottigliero https://opencollective.com/ukvma/expenses/114718
satyam-bholah1 https://opencollective.com/newhamsolidarityfund/expenses/109887
victoria10 https://opencollective.com/tpf/expenses/115336
victoria10 https://opencollective.com/tpf/expenses/115344
victoria10 https://opencollective.com/tpf/expenses/115351

I'm not sure yet how to best approach this.

alanna commented 1 year ago

Maybe the invitation notification could be "from" the individual inviter instead of emphsising that it's the Collective inviting you to submit an expense? However, this conflicts with the simplicity of "[Collective] wants to pay you" which helps get the message across. Maybe it could say "Request payment from [Collective]"?