Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unauthorized Warning creating new form #58

Closed
luca-bellenghi opened this issue Jan 22, 2013 · 1 comment
Closed

Unauthorized Warning creating new form #58

luca-bellenghi opened this issue Jan 22, 2013 · 1 comment

Comments

@luca-bellenghi
Copy link

I have created a new archetype based on FormFolder; I noticed a strange behavior with fields created in the FormFolder/initializeArchetype method that I customized: every time I get an "Unauthorized" error with fields creation. But every content at the end was correctly created/configured under this form. I noticed that in the moment I get the Unauthorized, the method it's running with Anonymous User.

I have checked this behaviour with original FormFolder code (1.7.6 version, with Plone 4.2) and also here I noticed that during creation, in a given moment this method is running with anonymous user and get this warning:
"User not authorized to create mail adapters. Form Folder created with no action adapter."
But also in this case the mailer adapter was correctly created (and of course here the exception seems handled in some way).
This problem happened to me also with other field types in my custom form.

I think a solution could be the one to check if current user is not the Anonymous one and only in this case execute this code: usually anonymous can't create objects.
But I'm guessing if this could be a problem.

@vangheem
Copy link
Collaborator

vangheem commented Feb 1, 2013

anonymous can't create objects unless you create them in a special way that bypasses security::

    ob = type_info._constructInstance(self, id)

I'm a little confused at your ticket though. Where is the problem in pfg? I will close the ticket until it's made more clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants