thanks to David Glick, who guided me, I ended up with a very simple solution involving the add
method of the AddForm
class:
class MyAddView(dexterity.AddForm):
grok.name('MyType')
grok.require('my.package.AddMyType')
def update(self):
# check here if the user is anonymous and raise exception if not
super(AddView, self).update()
def add(self, object):
container = aq_inner(self.context)
addContentToContainer(container, object, checkConstraints=False)
self.immediate_view = container.absolute_url()
to understand it better, you may want to take a look at the original code in plone.dexterity.
one important thing you may also note is that you probably need to fix your workflow permissions to remove Owner role from some of them, or you could end with content editable by anonymous users also.