For my use case, users do not normally have permission to create content type Foobar anywhere on the site. I want to provide a form that lets a user provide some information and then creates Foobar content behind the scenes. The problem is that the API, down to a low level, checks for permission to create that content type and fails.
I'd like to use plone.api.env.adopt_roles to temporarily grant an appropriate role within that form's button method. That seems very simple to do, but I've only ever seen adopt_roles and adopt_user used in testing and thus am a bit nervous there are some gotchas that make this a "DO NOT USE IN PROD" type of feature.
There are other ways around this I can think of, but they seem way less convenient.