Forge Authorize API in Confluence

Hi! I was trying to use the authorize api to display a menu based on whether the user has update permission on a confluence page.

I was trying to use the followings with page.id:

onConfluenceContent: (contentIds: Id | Id[]) => {
    canRead: () => Promise<boolean>;
    canUpdate: () => Promise<boolean>;
    canDelete: () => Promise<boolean>;
  };

from which none of the methods resolved true. I can update the page though.

Is it a bug or am I missing something?

Thanks!

Hi @BlintBerente ,

Do you mind confirming that you are using the Authorize API in your app function and not your Custom UI view.

Regards,
Dugald

Hi, thanks for replying,

we are using custom UI and calling a resolver using @forge/bridge and then calling authorize from @forge/api in the resolver.

Hope this answers your question.

Hi @BlintBerente ,

I believe the problem you are having is that your app does not have the read:confluence-content.permission permission in its manifest. If this is the case, please add the permission, redeploy (forge deploy) and upgrade the installation (forge install --upgrade).

Note that the API is really just a convenience function for Check content permissions, but I’ve raised FRGE-1251: Highlight the need for permission read scopes because:

  1. The documentation should point out the need for the scope/permission, and
  2. I believe it is misleading for the API to return a value of false when the app doesn’t have permission. Presumably the implementation of the API is swallowing a 401 response when it should be propagating the error.

Regards,
Dugald

1 Like

This seams like the reason, thank you very much, I have overlooked that part!

1 Like