using allowed content types in 2.1

classic Classic list List threaded Threaded
3 messages Options
Reinout van Rees Reinout van Rees
Reply | Threaded
Open this post in threaded view
|

using allowed content types in 2.1

Hello all,

What I want: allow one content type ('Pressrelease') only in one
specific folder ('/financial/pressreleases'). I don't want those
pressreleases somewhere else. Plus, in that folder I only want
pressreleases.

Using the new 2.1 restriction mechanism makes it easy to filter out
everything except 'Pressrelease', that's easy and handy.

After that I started to run into problems:

* I had Pressrelease's 'global_allow' set to 0, to keep it from
  showing up everywhere. But you can't use the restriction mechanism
  to un-restrict something.

* OK, I set global_allow to 1 and try to restrict the adding of
  Pressrelease: no luck, as that's not possible in the portal root.

* OK, you can set some restrictions on 'Plone Site' in portal_types.
  But then you probably need to enable the restriction using the
  restriction mechanism also on the subfolders of the root.

* Calling self.portal.allowedContentTypes() in the unittest gives me
  an empty list. Wtf? I must be doing something wrong here...

In the end I just deleted the code I produced today :-(
So if anyone has a tip on how to do this the right way?

Reinout

--
Reinout van Rees                         [hidden email]
http://vanrees.org/weblog/                  http://zestsoftware.nl/
"Military engineers build missiles. Civil engineers build targets."


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Plone-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers
Luca Olivetti-4 Luca Olivetti-4
Reply | Threaded
Open this post in threaded view
|

Re: using allowed content types in 2.1

En/na Reinout van Rees ha escrit:

> Hello all,
>
> What I want: allow one content type ('Pressrelease') only in one
> specific folder ('/financial/pressreleases'). I don't want those
> pressreleases somewhere else. Plus, in that folder I only want
> pressreleases.
>
> Using the new 2.1 restriction mechanism makes it easy to filter out
> everything except 'Pressrelease', that's easy and handy.
>
> After that I started to run into problems:
>
> * I had Pressrelease's 'global_allow' set to 0, to keep it from
>   showing up everywhere. But you can't use the restriction mechanism
>   to un-restrict something.

But then you can 'filter content types' in /financial/pressreleases and
select 'Pressrelease' as an 'Allowed content type'
(allowed_content_types of an archetype's attribute if you're doing it in
code).
It's working here this way.

Bye

--
Luca Olivetti
Wetron Automatización S.A. http://www.wetron.es/
Tel. +34 93 5883004      Fax +34 93 5883007


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Plone-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers
Kai Diefenbach Kai Diefenbach
Reply | Threaded
Open this post in threaded view
|

Re: using allowed content types in 2.1

In reply to this post by Reinout van Rees
Hello Reinout,

Reinout van Rees wrote:

> What I want: allow one content type ('Pressrelease') only in one
> specific folder ('/financial/pressreleases'). I don't want those
> pressreleases somewhere else. Plus, in that folder I only want
> pressreleases.

1. Provide Pressrelease with a own Add-Permission -> e.g.
AddPressrelease (See ATContentTypes/__init__.py for a example)

2. Go to the portal's security tab and remove the new
AddPressrelease-permission from the Manager role

3. Go to the '/financials/pressreleases'-folder's security tab and
assign the AddPressrelease-permission to the role you want and remove
the Add<Type-You-Don't-Want>-Permissions.

HTH,
Bye Kai



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Plone-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/plone-developers