How can my server for a Connect add-on determine what permissions a user has? I'm looking for ADMINISTER specifically, but it's unlikely to be right-specific.
I found two options, none of which seems ideal:
Am I missing something? Are these the only options?
I would recommend skipping the REST API completely, and use conditions to determine that:
What you can do is to have 2 different entry points into whatever webItem/webPanel you are providing, and either separate it into different files (if you are referring to html files) or use the same base URL and include different query parameters in each one. One would check whether the user is admin, and the other one would check the same condition, but with invert:true.
So for example, the one with admin permission would point to:
and the other inverted condition would point to:
and then you can just read it out of the query parameters.
Of course, this only works if you are doing something that interacts with the user in the browser and is going to present the information right away. If it's reacting to a webhook or something like that, then you probably wouldn't be able to use what I mentioned. In that case, a little bit more information about your use case would be required.
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs