[Zope3-checkins] CVS: Zope3/src/zope/app/utilities - permission_edit.pt:1.1.2.1 schema.py:1.1.2.8

Sidnei da Silva sidnei at x3ng.com.br
Wed Aug 13 12:36:34 EDT 2003


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

Modified Files:
      Tag: dreamcatcher-ttwschema-branch
	schema.py 
Added Files:
      Tag: dreamcatcher-ttwschema-branch
	permission_edit.pt 
Log Message:
forgot this one

=== Added File Zope3/src/zope/app/utilities/permission_edit.pt ===
<html metal:use-macro="views/standard_macros/page">
 <head>
  <title metal:fill-slot="title" i18n:translate="">
    Process Definition <-> Content Type Registry
  </title>
</head>

<body>
<div metal:fill-slot="body">

  <p tal:define="status view/update"
     tal:condition="status"
     tal:content="status" />

  <form action="./@@edit.html" method="POST">
    <h3 tal:content="view/label">Label</h3>

    <tal:block define="widgets view/getPermissionWidgets"
               condition="widgets">
      <h3 i18n:translate="">Map permissions to Schema fields</h3>

      <tal:block repeat="widget widgets">
        <h5 tal:content="string:${widget/fieldName} (${widget/fieldName})">
          FieldName (Field Title)
        </h5>
        <div class="row" tal:replace="structure widget/getter/row">
          <div class="label" i18n:translate="">Get Permission</div>
          <div class="field">

          </div>
        </div>
        <div class="row" tal:replace="structure widget/setter/row">
          <div class="label" i18n:translate="">Set Permission</div>
          <div class="field">

          </div>
        </div>
      </tal:block>
      <div class="row">
        <div class="controls" style="width: 100%">
          <input type="submit" value="Refresh"
                 i18n:attributes="value refresh-button" />
          <input type="submit" value="Change" name="CHANGE"
                 i18n:attributes="value change-button" />
         </div>
      </div>
    </tal:block>

  </form>

</div>
</body>
</html>

=== Zope3/src/zope/app/utilities/schema.py 1.1.2.7 => 1.1.2.8 ===
--- Zope3/src/zope/app/utilities/schema.py:1.1.2.7	Wed Aug 13 10:42:18 2003
+++ Zope3/src/zope/app/utilities/schema.py	Wed Aug 13 11:36:28 2003
@@ -19,10 +19,15 @@
 from zope.component import getAdapter
 from zope.app.context import ContextWrapper
 from zope.interface import implements
-from zope.app.form.utility import setUpEditWidgets, applyWidgetsChanges
+from zope.app.form.utility import setUpEditWidgets, \
+     applyWidgetsChanges, setUpWidget
+from zope.app.security.permission import PermissionField
+from zope.security.checker import CheckerPublic, Checker
+from zope.security.proxy import Proxy
 from zope.proxy import removeAllProxies
 from zope.app.browser.container.adding import Adding
 from zope.app.browser.form.editview import EditView
+from zope.app.browser.form.submit import Update
 from zope.app.i18n import ZopeMessageIDFactory as _
 from zope.app.interfaces.utilities import ISchemaAdding
 from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
@@ -170,7 +175,7 @@
         for name, field in getFieldsInOrder(schema):
             # Try to get current settings
             if not hasattr(self.context, 'schemaPermissions'):
-                self.context.schemaPermissions = PersistentDict()
+                removeAllProxies(self.context).schemaPermissions = PersistentDict()
             if self.context.schemaPermissions.has_key(name):
                 get_perm, set_perm = self.context.schemaPermissions[name]
             else:




More information about the Zope3-Checkins mailing list