[Archetypes-users] Developing New archetypes product

2 views
Skip to first unread message

paul...@gmail.com

unread,
Mar 23, 2011, 5:03:12 AM3/23/11
to archetyp...@lists.sourceforge.net
I am attempting to teach myself Plone4. I am a long time user, but I have
never developed a project on the file system. I have many Plone books, but
they are of ancient date and now largely useless.

I decided to make a product that would store and process potential new site
users. I am sure there are probably already dozens of products out there
that do this, but I figured I would make my own as a way of learning (and to
get exactly what I want).

So far I have two archetype objects:

1. A collection that holds only new user requests, called something like
PotentialNewUsersFolder.
2. An archetype that holds data containing a new user request, called
PotentialNewUser.

The workflow would be something like this:

1. Anonymous user requests permission to use plone site when they edit and
add a PotentialNewUser archetype to the collection PotentialNewUsersFolder.
Upon submission/addition of the PotentialNewUser object, the object goes
straight to review status, and is now only readable by site users with the
manager role. At this time an email is sent to the potential new user
notifying them that their request is being reviewed. Another email is sent
to all site managers to let them know a potential new user wants to join the
site.

2. Any manager can see and review the request (The PotentialNewUser type
contains a text field where the user lists reasons why they want to join the
site and the manager can review this information and make a decision). The
manager can choose to add the user to the site by Publishing the archetypes
object. Publishing the object registers the user with the site and then
deletes the object (since it is no longer needed). An email is sent to the
new user to tell them that they may now login.

3. To deny the request the manager just deletes it. I think this sends an
email, but I am not sure.

My Questions:

So I have most of the above working in some fashion. My main question is
about permissions:

1. Even when I go into the ZMI and turn every security setting to anonymous,
I cannot get my dev site to allow an unauthenticated user to add an
archetype object. Do I need to create a custom work flow to do this? Setting
custom permissions does not seem to work in the product or the ZMI. I have
googled this and searched on Plone and found some of the recommendations on
how to allow anonymous content, but the recommendations do not work in Plone
4 (at least as presented). Everything works as a regular site user, however.


Another question is about generic setup:
2. How do I use generic setup to manage the public/private rights of a
collection on install? I can get the collection installed (using structure),
but I cannot figure out how to make the collection public. Nor can I figure
out how to hide it from the default navigation. Removing the product also
leaves the collection behind, and I would like to uninstall it upon removal
as well.

And finally, I have a question about rerouting the view:
I would like the view the anonymous user sees after adding the object to
redirect to a nice "thank you" screen, since the anonymous user can not view
their request after adding it. I would like the view the manager sees after
publishing the object to redirect to the object container view, as the
object itself is deleted when published and cannot be viewed.

Many thanks in advance for any assistance or tips,

Paul H


--
View this message in context: http://plone.293351.n2.nabble.com/Developing-New-archetypes-product-tp6199440p6199440.html
Sent from the Archetypes mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Archetypes-users mailing list
Archetyp...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/archetypes-users

Raphael Ritz

unread,
Mar 23, 2011, 6:53:37 AM3/23/11
to archetyp...@lists.sourceforge.net
On 3/23/11 10:03 AM, paul...@gmail.com
wrote:
[..]

> So I have most of the above working in some fashion. My main question is
> about permissions:
>
> 1. Even when I go into the ZMI and turn every security setting to anonymous,
> I cannot get my dev site to allow an unauthenticated user to add an
> archetype object. Do I need to create a custom work flow to do this?

That would be one way, yes.

I've enabled anonymous content creation on Plone 3 once
by extending the 'simple_publication_workflow' to start
out with a new 'initial' state where anonymous has all
rights. This state has to automatic transitions with
different guard conditions: one that takes it to a
new 'anonymous' state if the user is anonymous where
anonymous has all rights needed and and another transition
to the 'private' state if the user is authenticated.

To keep the portal factory happy one also needs to add the
'Copy or move' permission to the workflow and grant it to
anonymous on the 'initial' and 'anonymous' state.

In addition you need to grant the 'Add portal content' and
eventually a type specific add permission to the folder where
these objects should be added (as you can't assign the Contributor
role to anonymous).


> Setting
> custom permissions does not seem to work in the product or the ZMI. I have
> googled this and searched on Plone and found some of the recommendations on
> how to allow anonymous content, but the recommendations do not work in Plone
> 4 (at least as presented). Everything works as a regular site user, however.
>
>
> Another question is about generic setup:
> 2. How do I use generic setup to manage the public/private rights of a
> collection on install?

Use a custom setup handler

> I can get the collection installed (using structure),
> but I cannot figure out how to make the collection public. Nor can I figure
> out how to hide it from the default navigation. Removing the product also
> leaves the collection behind, and I would like to uninstall it upon removal
> as well.

use a custom uninstall

>
> And finally, I have a question about rerouting the view:
> I would like the view the anonymous user sees after adding the object to
> redirect to a nice "thank you" screen, since the anonymous user can not view
> their request after adding it.

have the view check for the anonymous user and do a redirect
to parent in that case (request.response.redirect('..')

HTH,

Raphael

PS: on the plone-users list more people would see your questions.

Reply all
Reply to author
Forward
0 new messages