Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow async function in PermissionsBuilder to use custom claims

See original GitHub issue

It would be very helpful to be able to pass an async function to PermissionsBuilder, since user.getIdToken() returns a promise.

I want to use custom claims for managing permissions and with being able to access the token inside the PermissionsBuilder I can access the custom claims, as they are passed with the token.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

fgatti675commented, Jul 19, 2021

Awesome! Happy to know it works for you 😃 I need to add some more examples for these kind of use cases

fgatti675commented, Jul 19, 2021

Hi @davemecha I think it was already possible before, but I have made it a bit easier to add this kind of behaviour in version 0.44.0 You can return a promise in the NavigationBuilder, so you could get your user permissions and then save them in the authController, which is an internal controller you can get in some callbacks, as well as via a hook, if you have a custom component. I have modified the quickstart example to cover your use case: You fetch your data in the navigation builder, save it in the extra field of the authController and then retrieve it in your permissions builder 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Recommended best practice for role claims as permissions
I use Custom policy based authentication as described in the Microsoft article in ... permissionsBuilder; } protected override async Task ...
Read more >
Index (OFBiz trunk API)
Creates a child element with the given name and appends it to the element child node list. addChildElementCDATAValue(Element, String, String, Document) - Static ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found