I think that it's not a good idea to store permissions for ORM-mapper inside a class like PermissionToMapper, because it implicitly mixes permissions for different apps if they are started inside one process (e.g. for testing purposes).
May be it would be better to make own PermissionToMapper instance for each PermissionPlugin instance or use additional nesting level to somehow identify, which app is accessing permissions now.
I think that it's not a good idea to store permissions for ORM-mapper inside a class like PermissionToMapper, because it implicitly mixes permissions for different apps if they are started inside one process (e.g. for testing purposes).
May be it would be better to make own PermissionToMapper instance for each PermissionPlugin instance or use additional nesting level to somehow identify, which app is accessing permissions now.