Get permitted screens from GrantedAuthorities

Hello,

I’m trying to figure out how to programmatically retrieve a list of the authenticated user’s permitted screens. I couldn’t find a way to do this in the documentation or in the forum. Something like:

Collection<? extends GrantedAuthority> authorities = currentAuthentication.getAuthentication().getAuthorities();
for (GrantedAuthority grantedAuthority : authorities) {
    // get screens
}

Is this possible?

Thanks,
Adam

Hi Adam,

Yes, it’s possible.
Take a look at this section: Authorization :: Jmix Documentation, we’ve just added a few examples.

Regards,
Konstantin

Thank you for the examples in the documentation, Konstantin. They are very helpful.

Adam