Open mversic opened 1 year ago
the reason why GrantBox::execute
passes in validator_with_custom_token
test is because it skips the validation. Which indicates we should better add a test to guard against this sort of a bug
As I tried to properly solve this issue I found that it would be quite useful to first implement #3640
Users should not use default implementation in such places if they have some custom permission tokens defined. Need to think how we can force them to worry about it.
one possibility is to remove visit_grant_account_permission
from macro generation and force users to always write manual implementations
If a custom token (the one that is not part of
default.rs
) is defined in the validator every attempt to grant it to an account will fail with "undefined permission token". This happens becausevisit_grant_account_permission
implementation only looks for tokens that are defined withindefault.rs
it never takes into consideration that there are other tokens outsidedefault.rs