Skip to content

Commit

Permalink
Made the dependency subscriber trusted
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Fulton committed Aug 20, 2004
1 parent 3906bbc commit cc67c2e
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 7 deletions.
70 changes: 70 additions & 0 deletions configure.zcml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser"
xmlns:xmlrpc="http://namespaces.zope.org/xmlrpc"
i18n_domain="zope"
>

<adapter
provides=".interfaces.IFind"
for=".interfaces.IReadContainer"
permission="zope.ManageContent"
factory="zope.app.container.find.FindAdapter"
/>

<adapter
for=".interfaces.IReadContainer"
provides="zope.app.filerepresentation.interfaces.IReadDirectory"
factory=".directory.noop"
/>

<adapter
for=".interfaces.IWriteContainer"
provides="zope.app.filerepresentation.interfaces.IWriteDirectory"
factory=".directory.noop"
/>

<adapter
factory="zope.app.container.traversal.ContainerTraversable"
provides="zope.app.traversing.interfaces.ITraversable"
for="zope.app.container.interfaces.IReadContainer"
/>


<adapter
factory="zope.app.container.size.ContainerSized"
provides="zope.app.size.interfaces.ISized"
for="zope.app.container.interfaces.IReadContainer"
/>

<adapter
provides=".interfaces.INameChooser"
for="zope.app.container.interfaces.IWriteContainer"
factory=".contained.NameChooser"
/>

<subscriber
factory=".dependency.CheckDependency"
for="zope.app.container.interfaces.IObjectRemovedEvent"
trusted="y"
/>

<subscriber
for="zope.app.location.interfaces.ILocation
zope.app.container.interfaces.IObjectMovedEvent"
factory=".contained.dispatchToSublocations"
>
Handler dispatches moved events to sublocations of the original object.
</subscriber>

<adapter
provides="zope.app.location.interfaces.ISublocations"
for="zope.app.container.interfaces.IReadContainer"
factory=".contained.ContainerSublocations"
/>

<content class=".constraints.ItemTypePrecondition">
<allow interface=".constraints.IItemTypePrecondition" />
</content>

</configure>
8 changes: 1 addition & 7 deletions dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,9 @@

from zope.app import zapi
from zope.app.dependable.interfaces import IDependable, DependencyError
from zope.proxy import removeAllProxies

def CheckDependency(event):

# We have to remove the proxies here to be able to get at
# annotations. Perhaps this should be a trusted subscriber, but we
# don't have those yet.

object = removeAllProxies(event.object)
object = event.object
dependency = IDependable(object, None)
if dependency is not None:
dependents = dependency.dependents()
Expand Down

0 comments on commit cc67c2e

Please sign in to comment.