What is the best way to check for a permission on a context by role instead of by user/username? For instance, to see if the Anonymous role is granted access to the 'View' permission. The best I could find was the following, which seems like it's probably missing some better exposed API
name, value = [perm[:2] for perm in obj.ac_inherited_permissions(1) if perm[0] == 'View'][0]
p = Permission(name, value, obj)
anon_view = 'Anonymous' in p.getRoles(default=[])
For context, a feature request is to indicate to an editor somehow that internal links within a Page point to objects that are in a workflow state that the user can't see.