[Erp5-report] r38726 fabien - in /experimental/bt5/erp5_credential: SkinTemplateItem/portal...

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Sep 28 16:07:25 CEST 2010


Author: fabien
Date: Tue Sep 28 16:07:20 2010
New Revision: 38726

URL: http://svn.erp5.org?rev=38726&view=rev
Log:
- add Auditor Proxy role to allow annonymous to get credential information.
- Make not possible to call this script from the url
- update local roles after creating new assignement (add a script to do this :
CredentialRequest_updateLocalRolesOnSecurityGroups)

Added:
    experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_updateLocalRolesOnSecurityGroups.xml
Modified:
    experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createPersonAndAssignment.xml
    experimental/bt5/erp5_credential/bt/revision

Modified: experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createPersonAndAssignment.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createPersonAndAssignment.xml?rev=38726&r1=38725&r2=38726&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createPersonAndAssignment.xml [utf8] (original)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createPersonAndAssignment.xml [utf8] Tue Sep 28 16:07:20 2010
@@ -51,7 +51,13 @@
         <item>
             <key> <string>_body</string> </key>
             <value> <string>"""For a credential request as context, we set the related person informations,\n
-the assignments of the person and send notificaiton email"""\n
+the assignments of the person and send notificaiton email\n
+Proxy:\n
+Auditor -- allow to get credential request informations"""\n
+\n
+# check the script is not called from a url\n
+if REQUEST is not None:\n
+  return None\n
 \n
 if context.getCorporateName():\n
   related_portal_type.append(\'Organisation\')\n
@@ -72,6 +78,9 @@ context.CredentialRequest_updatePersonAs
 #Create account\n
 login, password = context.CredentialRequest_createUser()\n
 \n
+#Update local roles\n
+context.CredentialRequest_updateLocalRolesOnSecurityGroups()\n
+\n
 #Send notification in activities\n
 context.activate(activity=\'SQLQueue\').CredentialRequest_sendAcceptedNotification(login,password)\n
 </string> </value>
@@ -84,12 +93,14 @@ context.activate(activity=\'SQLQueue\').
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string>related_portal_type = [\'Person\']</string> </value>
+            <value> <string>related_portal_type = [\'Person\'], REQUEST=None</string> </value>
         </item>
         <item>
             <key> <string>_proxy_roles</string> </key>
             <value>
-              <tuple/>
+              <tuple>
+                <string>Auditor</string>
+              </tuple>
             </value>
         </item>
         <item>
@@ -110,13 +121,15 @@ context.activate(activity=\'SQLQueue\').
                   <dictionary>
                     <item>
                         <key> <string>co_argcount</string> </key>
-                        <value> <int>1</int> </value>
+                        <value> <int>2</int> </value>
                     </item>
                     <item>
                         <key> <string>co_varnames</string> </key>
                         <value>
                           <tuple>
                             <string>related_portal_type</string>
+                            <string>REQUEST</string>
+                            <string>None</string>
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>append</string>
@@ -142,6 +155,7 @@ context.activate(activity=\'SQLQueue\').
                 <list>
                   <string>Person</string>
                 </list>
+                <none/>
               </tuple>
             </value>
         </item>

Added: experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_updateLocalRolesOnSecurityGroups.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_updateLocalRolesOnSecurityGroups.xml?rev=38726&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_updateLocalRolesOnSecurityGroups.xml (added)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_updateLocalRolesOnSecurityGroups.xml [utf8] Tue Sep 28 16:07:20 2010
@@ -0,0 +1,133 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_container</string> </key>
+                                <value> <string>container</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_context</string> </key>
+                                <value> <string>context</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_m_self</string> </key>
+                                <value> <string>script</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_body</string> </key>
+            <value> <string>"""After assignment creation/update, the user may have some different security on his person\n
+so it may be updated.\n
+Proxy: Manager -- allow to set password on all account"""\n
+\n
+person = context.getDestinationDecisionValue(portal_type="Person")\n
+person.updateLocalRolesOnSecurityGroups()\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>_proxy_roles</string> </key>
+            <value>
+              <tuple>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>0</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>_getattr_</string>
+                            <string>context</string>
+                            <string>person</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>CredentialRequest_updateLocalRolesOnSecurityGroups</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: experimental/bt5/erp5_credential/bt/revision
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/bt/revision?rev=38726&r1=38725&r2=38726&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/bt/revision [utf8] (original)
+++ experimental/bt5/erp5_credential/bt/revision [utf8] Tue Sep 28 16:07:20 2010
@@ -1 +1 @@
-206
\ No newline at end of file
+207
\ No newline at end of file




More information about the Erp5-report mailing list