[Checkins]
SVN: grok/branches/gotcha-configuration-actions/src/grok/meta.py
Forgot to import IRole (removed unnecessary import of Role).
Philipp von Weitershausen
philikon at philikon.de
Tue Oct 9 11:46:31 EDT 2007
Log message for revision 80749:
Forgot to import IRole (removed unnecessary import of Role).
JSON grokker now uses configuration actions
Changed:
U grok/branches/gotcha-configuration-actions/src/grok/meta.py
-=-
Modified: grok/branches/gotcha-configuration-actions/src/grok/meta.py
===================================================================
--- grok/branches/gotcha-configuration-actions/src/grok/meta.py 2007-10-09 15:42:33 UTC (rev 80748)
+++ grok/branches/gotcha-configuration-actions/src/grok/meta.py 2007-10-09 15:46:30 UTC (rev 80749)
@@ -23,7 +23,7 @@
IBrowserSkinType)
from zope.publisher.interfaces.xmlrpc import IXMLRPCRequest
from zope.security.interfaces import IPermission
-from zope.app.securitypolicy.role import Role
+from zope.app.securitypolicy.interfaces import IRole
from zope.app.securitypolicy.rolepermission import rolePermissionManager
from zope.annotation.interfaces import IAnnotations
@@ -246,18 +246,27 @@
factory.__name__, (factory,),
{'__view_name__': method.__name__}
)
- component.provideAdapter(
- method_view, (view_context, IDefaultBrowserLayer),
- interface.Interface,
- name=method.__name__)
+ adapts = (view_context, IDefaultBrowserLayer)
+ name = method.__name__
+ config.action(
+ discriminator=('adapter', adapts, interface.Interface, name),
+ callable=component.provideAdapter,
+ args=(method_view, adapts, interface.Interface, name),
+ )
+
# Protect method_view with either the permission that was
# set on the method, the default permission from the class
# level or zope.Public.
permission = getattr(method, '__grok_require__',
default_permission)
- make_checker(factory, method_view, permission)
+
+ config.action(
+ discriminator=('protectName', method_view, '__call__'),
+ callable=make_checker,
+ args=(factory, method_view, permission),
+ )
return True
More information about the Checkins
mailing list