onflow / flips

Flow Improvement Proposals
24 stars 22 forks source link

Restrict `capabilities.publish` to account's own capabilities #196

Open bluesign opened 10 months ago

bluesign commented 10 months ago

Currently it is possible to republish someone else's capability via new capabilities API, I think it makes sense to keep old restriction.

There are a lot of scenarios ( voting, gating with existence of NFT ) usually checking if account owns some balance or resource, by checking a public path capability. Now it will be extra burden for developers and small foot gun with this change of behaviour.

FLIP suggests adding a restriction to the capability API, permitting only capabilities from the same account address to be published via capabilities.publish.

Previous Discussion: https://github.com/onflow/cadence/issues/2768 Draft PR: https://github.com/onflow/cadence/pull/2782 FLIP Discussion: https://github.com/onflow/flips/pull/197