[Zope-PTK] Re: Show by Permission

Shane Hathaway shane@digicool.com
Thu, 31 Aug 2000 10:23:49 -0400


Chris Withers wrote:
> 
> Shane Hathaway wrote:
> > That facility already exists in PTKDemo.  Look at the addMember()
> > method of DemoMembershipTool.  It creates a PortalFolder for the member
> > and sets up non-acquired permissions which prevent anonymous access.
> > When an item is marked "published", special permission settings are set
> > up by WorkflowTool that allow anonymous access to that item only.
> 
> I wonder if this permission thing could be leveraged so you can only
> show stuff that has been reviewed?
> (I'm thinking in a Swishdot context here...)
> 
> The key thing there was 'show'. I might, say, want to build a thread
> list of only approved articles, coudl the permissions stuff be used to
> do this easily?

Yes, it already does that.  That was the point of the catalog comment.
:-)

To show the list of approved articles, you just have to do a catalog
search using the PTKBase CatalogTool.  CatalogTool will automatically
add a field to the search criteria called "allowedRolesAndUsers" that
prevents the results from including items the user is not allowed to
see.

That way, Squishdot will automatically filter the front page based on
fine-grained permissions.  Cool, huh?

Shane