# How does work "Get my permissions" when called anonymously?

**URL:** <https://community.developer.atlassian.com/t/how-does-work-get-my-permissions-when-called-anonymously/72849>\
**Category:** Jira Cloud\
**Tags:** rest-api, atlassian-connect\
**Created:** [September 13, 2023, 2:14pm UTC](https://community.developer.atlassian.com/t/how-does-work-get-my-permissions-when-called-anonymously/72849 "2023-09-13T14:14:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![SylvainCaillet1](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@SylvainCaillet1](https://community.developer.atlassian.com/u/SylvainCaillet1)\
**Post date:** [September 13, 2023, 2:14pm UTC](https://community.developer.atlassian.com/t/how-does-work-get-my-permissions-when-called-anonymously/72849/1 "2023-09-13T14:14:33Z")

</div>

Hi community,

Trying to call the [my permission end-point](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-permissions/#api-rest-api-3-mypermissions-get) to get permissions for the connected user from my connect app (registered in a Jira cloud for dev env), it’s not working properly, always returning false for all the permissions I check, even when a site admin is connected.

What I don’t understand is : how does Jira know which user is asking to know their permissions since the API doesn’t mention any parameter nor header helping identifying the user ?

Thanks to help me to understand how this works 🙂  
Best regards,  
Sylvain

---

<div class="post-metadata">

**Author:** ![marc](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/marc/32/39047_2.png) [@marc](https://community.developer.atlassian.com/u/marc)\
**Post date:** [September 13, 2023, 2:40pm UTC](https://community.developer.atlassian.com/t/how-does-work-get-my-permissions-when-called-anonymously/72849/2 "2023-09-13T14:40:54Z")

</div>

Jira knows the user from the authorization of the user. E.g. from the authorization header. The user is not in the API route.

---

<div class="post-metadata">

**Author:** ![SylvainCaillet1](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@SylvainCaillet1](https://community.developer.atlassian.com/u/SylvainCaillet1)\
**Post date:** [September 13, 2023, 2:53pm UTC](https://community.developer.atlassian.com/t/how-does-work-get-my-permissions-when-called-anonymously/72849/3 "2023-09-13T14:53:18Z")

</div>

Hi Marc, thanks for your answer.  
By the authorization header, in my case of an app using JWT, you mean I should also add this authorization JWT header to the call.  
I tried but then I got a 401 on the call.  
Maybe I misunderstand something.

---

<div class="post-metadata">

**Author:** ![marc](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/marc/32/39047_2.png) [@marc](https://community.developer.atlassian.com/u/marc)\
**Post date:** [September 13, 2023, 3:14pm UTC](https://community.developer.atlassian.com/t/how-does-work-get-my-permissions-when-called-anonymously/72849/4 "2023-09-13T15:14:19Z")

</div>

Yes, you must add the header to the API call.

You can also, for testing, use the basic auth header used in the example code in the documentation. That should get you started and return another value than `false`.

---

<div class="post-metadata">

**Author:** ![SylvainCaillet1](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@SylvainCaillet1](https://community.developer.atlassian.com/u/SylvainCaillet1)\
**Post date:** [September 13, 2023, 3:28pm UTC](https://community.developer.atlassian.com/t/how-does-work-get-my-permissions-when-called-anonymously/72849/5 "2023-09-13T15:28:46Z")

</div>

Ok, I’ll try with an API key but that’s weird I got a 401 when I add the auth header with the user JWT I got from Jira …

---

<div class="post-metadata">

**Author:** ![SylvainCaillet1](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@SylvainCaillet1](https://community.developer.atlassian.com/u/SylvainCaillet1)\
**Post date:** [September 14, 2023, 7:13am UTC](https://community.developer.atlassian.com/t/how-does-work-get-my-permissions-when-called-anonymously/72849/6 "2023-09-14T07:13:47Z")

</div>

So … I tried with an API token and it worked fine.  
But my app can’t use API tokens from all our customer Jira instances ! I need to have it working properly with the JWT sent by Jira for the connected user. Am I only supposed to add a HTTP header :

```auto
Authorization: JWT <the_jwt_got_from_Jira_call>

```

?

---

<div class="post-metadata">

**Author:** ![marc](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/marc/32/39047_2.png) [@marc](https://community.developer.atlassian.com/u/marc)\
**Post date:** [September 14, 2023, 8:01am UTC](https://community.developer.atlassian.com/t/how-does-work-get-my-permissions-when-called-anonymously/72849/7 "2023-09-14T08:01:54Z")

</div>

The Atlassian connect frameworks have a method to add the authorization header for you.

See [Connect app authorization](https://developer.atlassian.com/developer-guide/connect-app-authorization/)

---

<div class="post-metadata">

**Author:** ![SylvainCaillet1](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@SylvainCaillet1](https://community.developer.atlassian.com/u/SylvainCaillet1)\
**Post date:** [September 14, 2023, 11:46am UTC](https://community.developer.atlassian.com/t/how-does-work-get-my-permissions-when-called-anonymously/72849/8 "2023-09-14T11:46:47Z")

</div>

Yes, but unfortunately my app was written without this framework so I need to write it on my own.

I finally managed to have something working (no more 401) by building the usual JWT with qsh we used to query Jira API, not reusing the JWT sent by Jira admin page.  
But … again, Jira doesn’t know who is asking so answering always yes (based on the shared secret ??) to the question : has the user ADMINISTER permission ?

Any other idea ? 🙂

---

<div class="post-metadata">

**Author:** ![SylvainCaillet1](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@SylvainCaillet1](https://community.developer.atlassian.com/u/SylvainCaillet1)\
**Post date:** [September 14, 2023, 1:49pm UTC](https://community.developer.atlassian.com/t/how-does-work-get-my-permissions-when-called-anonymously/72849/9 "2023-09-14T13:49:04Z")

</div>

So, I moved to the API call [get bulk permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-permissions/#api-rest-api-3-permissions-check-post) using the accountId to check instead.  
But still, understand how to call get myPermissions in details from a connect App is interesting and useful 🙂
