How to correctly retrieve user permission from 'mypermissions' endpoint?

Hi.
I’m working on JIRA connect addon. I’ve created a module with global permission and now I want to know if current user has this permission.
So I added “act_as_user” scope in addon descriptor and tried to call ‘/rest/api/3/mypermissions’ with specified my permission in query parameter (in format ${addonKey}__${permissionKey}).

It work perfectly fine, when I’m calling this endpoint via curl and api-token (like in documentation examples), but when I’m trying to call it from my code with generated JWT token, endpoint always returns “havePermission”: false.

For specifying concrete user in my request I’m putting my accountId into subject claim of JWT.
Am I missing something here? Or may be I’m just using it wrong?