The whitelist feature is great, however my function need to be able to return a Promise, something like the example below :/
whitelist: function(request) {
return new Promise(function(resolve, reject) {
if (request.context && request.context.user) {
api.user.permitsAuthorizationPolicy({user: request.context.user, policy: '*'}).then(resolve).catch(function(error) {
reject();
}
} else {
reject();
}
});
}
Right now, without this support, I have middleware which is checking the policy, and saving it to the request object, then checking that boolean value within the whitelist function. It's tedious imo
Will you allow this functionality please as I'm sure others would want it too!
The whitelist feature is great, however my function need to be able to return a Promise, something like the example below :/
Right now, without this support, I have middleware which is checking the policy, and saving it to the request object, then checking that boolean value within the whitelist function. It's tedious imo
Will you allow this functionality please as I'm sure others would want it too!