[Checkins] SVN: megrok.kss/trunk/src/megrok/kss/components.py Fix problem with new grok security policy.

Uli Fouquet uli at gnufix.de
Thu Dec 18 22:49:36 EST 2008


Log message for revision 94185:
  Fix problem with new grok security policy.

Changed:
  U   megrok.kss/trunk/src/megrok/kss/components.py

-=-
Modified: megrok.kss/trunk/src/megrok/kss/components.py
===================================================================
--- megrok.kss/trunk/src/megrok/kss/components.py	2008-12-19 03:37:12 UTC (rev 94184)
+++ megrok.kss/trunk/src/megrok/kss/components.py	2008-12-19 03:49:36 UTC (rev 94185)
@@ -1,11 +1,25 @@
+import grok
 from zope.publisher.publish import mapply
 from kss.core import KSSView
 
+class DummyModel(grok.Model):
+    """A dummy model.
 
-class KSS(KSSView):
+    This model is needed to have a context for the `KSS` view
+    below. Otherwise grokking would fail. As soon as grok provides
+    `IGrokSecurityView` we can get rid of this.
+    """
+    pass
+
+class KSS(KSSView, grok.View):
     """This is the default KSS action class that binds to a content object.
+
+    We also derive from `grok.View` to let our views pass by the Grok
+    security checks. We also get some nice bonus features by that.
     """
 
+    grok.context(DummyModel)
+    
     def __init__(self, context, request):
         self.view = context
         super(KSS, self).__init__(context, request)



More information about the Checkins mailing list