You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 12, 2020. It is now read-only.
Hi- your library is really enjoyable and intuitive to use! I ran into an issue with the AND condition; if you pass it any async custom conditions as args, it does not await those conditions.
custom:userCanAccessResource is not awaited before permission is evaluated- permission.granted evaluates to "true" as long as all other conditions are met.
Even if you remove custom:sameOwner, you get the same result, so it doesn't seem to be an issue with combining sync with async conditions.
Looks like && Promise.resolve(elm) == elm in the containsPromisesmethod is the culprit; if you comment out that condition, async custom functions passed to AND get awaited properly.
It would seem that removing this logic is the fix, but is there a reason that it's there & should not be removed?
The text was updated successfully, but these errors were encountered:
Hi- your library is really enjoyable and intuitive to use! I ran into an issue with the AND condition; if you pass it any async custom conditions as args, it does not await those conditions.
Example- given the following grant definition:
custom:userCanAccessResource
is not awaited before permission is evaluated-permission.granted
evaluates to "true" as long as all other conditions are met.Even if you remove
custom:sameOwner
, you get the same result, so it doesn't seem to be an issue with combining sync with async conditions.Looks like
&& Promise.resolve(elm) == elm
in thecontainsPromises
method is the culprit; if you comment out that condition, async custom functions passed to AND get awaited properly.It would seem that removing this logic is the fix, but is there a reason that it's there & should not be removed?
The text was updated successfully, but these errors were encountered: