Determining user permissions from within a Jira Server Gadget on a dashboard

Is there any way from Javascript on a gadget on a shared dashboard to determine if the user has edit permission. Doing gadget prefs sets and gets for a user with view shared access to a dashboard actually succeed when running the gadget, but are not persisted to the database, so when the page is updated it will use the previous prefs set for the gadget.

For example, if you do a setPref() on a gadget in a shared, but not editable dashboard, it will actually succeed, and even if you read the values back you will get what you set.

If you then reload the page, you get back the previous prefs values. Jira seems to be caching the values when the gadgets setPref is called, but silently failing on persisting the prefs to the database. I tried writing a pref and reading it back figuring I’d get the previous value in the read-only case to use that as a test for the read-only cause, but Jira happily returns the newly set value.

I need to be able to determine if the user has edit access to the dashboard, and then disallow operations that will attempt to set gadget prefs, effectively putting the gadget in a “read-only” mode. I see no way to do this, or even find information that would allow me to make REST calls to the underlying platform to determine anything about the dashboard the gadget is embedded in.