[Zope3-Users] Permissions to use IWriteZopeDublinCore
Bernd Dorn
bernd.dorn at lovelysystems.com
Thu May 17 13:57:53 EDT 2007
On 17.05.2007, at 18:56, Kevin Gill (Newaddress) wrote:
> Hi,
>
> I am putting together a simple application based on Philipp Von
> Weitershausen's book.
>
> When an object is updated, I update the Dublin Core metadata in an
> event
> handler. The code is similar to the following...
>
> @adapter(IListing, IObjectModifiedEvent)
> def updateListingDCTitle(listing, event):
> dc = IWriteZopeDublinCore(listing)
> dc.title=u'TEST UPDATE'
>
u can remove the security proxy
from zope.app.security.proxy import removeSecurityProxy
removeSecurityProxy(dc).title = ...
> The ZCML declaration is...
>
> <subscriber handler=".actor.updateListingDCTitle" />
>
> I have configured a user who can edit the 'Listing'. When they try to
> edit the listing, they get a permissions error caused by the event
> handler.
>
>
>
> If I assign permissions to the editor to modify the Dublin Core
> metadata, they get access to the meta-data tab in the ZMI user
> interface, which I would rather avoid. This grant works but I am
> looking
> for a better way of doing this.
>
> <grant permission="zope.app.dublincore.change"
> role="directory.Editor" />
>
>
>
> How should I go about letting the event handler update the Dublin Core
> metadata?
>
> I tried adding trusted="true" to the subscriber zcml declaration, but
> this is ignored when a handler is used rather than a factory.
>
>
> Thanks
>
> Kevin
>
>
> **********************************************************************
> ****************************
> www.commuterhomes.ie - MyHome.ie are sponsoring the Commuter Homes
> Exhibition
> 2007 which takes place this Sunday 4th of March in The Lynch Green
> Isle Hotel,
> Naas Road, Dublin 22 from 1pm – 6pm. FREE ADMISSION.
>
> **********************************************************************
> ****************************
> The contents of this email and any attachments are confidential.
> They are intended for the named recipient(s) only.
> If you have received this email in error please notify the system
> manager or the
> sender immediately and do not disclose the contents to anyone or
> make copies.
>
> ** eSafe scanned this email for viruses, vandals and malicious
> content. **
> **********************************************************************
> ****************************
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
More information about the Zope3-users
mailing list