Author: david
Date: Tue Sep 29 14:13:30 2009
New Revision: 3597

Log:
When creating new objects, test permissions against root object.

Modified:
   trunk/plugins/qbAclPlugin/lib/QubitAcl.class.php

Modified: trunk/plugins/qbAclPlugin/lib/QubitAcl.class.php
==============================================================================
--- trunk/plugins/qbAclPlugin/lib/QubitAcl.class.php    Tue Sep 29 14:12:07 
2009        (r3596)
+++ trunk/plugins/qbAclPlugin/lib/QubitAcl.class.php    Tue Sep 29 14:13:30 
2009        (r3597)
@@ -117,6 +117,13 @@
   {
     $permission = self::INHERIT;
 
+    // For creating new objects, use the permission set from the root object
+    // TODO: Handle an expanded list of classes elegantly (e.g. not 'switch')
+    if ('QubitInformationObject' == get_class($aco) && null === $aco->id)
+    {
+      $aco = QubitInformationObject::getRoot();
+    }
+
     $acoChain = self::getAcoChain($aco);
 
     // Check user permissions first

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to