[Zope3-checkins] CVS: Zope3/src/zope/app/security - protectclass.py:1.2.46.1

Sidnei da Silva sidnei at x3ng.com.br
Tue Aug 12 11:05:18 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/security
In directory cvs.zope.org:/tmp/cvs-serv30555

Modified Files:
      Tag: dreamcatcher-ttwschema-branch
	protectclass.py 
Log Message:
Make 'like_class' use the setattr permissions of the originating class as well

=== Zope3/src/zope/app/security/protectclass.py 1.2 => 1.2.46.1 ===
--- Zope3/src/zope/app/security/protectclass.py:1.2	Wed Dec 25 09:13:15 2002
+++ Zope3/src/zope/app/security/protectclass.py	Tue Aug 12 10:05:09 2003
@@ -71,14 +71,19 @@
         return
 
     # We know a dictionart get method was used because we set it
-    unto_protections = unto_checker.getPermission_func().__self__
+    unto_get_protections = unto_checker.getPermission_func().__self__
+    unto_set_protections = unto_checker.getSetattrPermission_func().__self__
 
     checker = getCheckerForInstancesOf(class_)
     if checker is None:
-        checker = Checker({}.get)
+        checker = Checker({}.get, {}.get)
         defineChecker(class_, checker)
 
     # OK, so it's a hack.
-    protections = checker.getPermission_func().__self__
-    for name in unto_protections:
-        protections[name] = unto_protections[name]
+    get_protections = checker.getPermission_func().__self__
+    for name in unto_get_protections:
+        get_protections[name] = unto_get_protections[name]
+
+    set_protections = checker.getSetattrPermission_func().__self__
+    for name in unto_set_protections:
+        set_protections[name] = unto_set_protections[name]




More information about the Zope3-Checkins mailing list