make download and publish grants finally work in grants grid
authorPhilipp Schüle <p.schuele@metaways.de>
Wed, 19 Jul 2017 13:00:02 +0000 (15:00 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 19 Jul 2017 14:14:36 +0000 (16:14 +0200)
* they had to be added to js grants model

Change-Id: I90bda46453577f027c7d625a5bcfabee6de45fef
Reviewed-on: http://gerrit.tine20.com/customers/5255
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tests/tine20/Filemanager/Frontend/JsonTests.php
tine20/Tinebase/js/Models.js

index d902ee4..d16ef4c 100644 (file)
@@ -1843,11 +1843,15 @@ class Filemanager_Frontend_JsonTests extends TestCase
             Tinebase_Model_Grants::GRANT_ADMIN => false,
             Tinebase_Model_Grants::GRANT_FREEBUSY => false,
             Tinebase_Model_Grants::GRANT_PRIVATE => false,
-            Tinebase_Model_Grants::GRANT_DOWNLOAD => false,
+            Tinebase_Model_Grants::GRANT_DOWNLOAD => true,
             Tinebase_Model_Grants::GRANT_PUBLISH => false,
         );
         $result = $this->_getUit()->saveNode($node);
         self::assertEquals(2, count($result['grants']));
+        self::assertEquals(1, count($result['grants'][0][Tinebase_Model_Grants::GRANT_DOWNLOAD]));
+
+        $savedNode = $this->_getUit()->getNode($result['id']);
+        self::assertEquals(1, count($savedNode['grants'][0][Tinebase_Model_Grants::GRANT_DOWNLOAD]));
 
         // switch to sclever
         Tinebase_Core::set(Tinebase_Core::USER, $this->_personas['sclever']);
index f59eb1b..d2b2a0b 100644 (file)
@@ -121,6 +121,8 @@ Tine.Tinebase.Model.Grant = Ext.data.Record.create([
     {name: 'privateGrant', type: 'boolean'},
     {name: 'exportGrant',  type: 'boolean'},
     {name: 'syncGrant',    type: 'boolean'},
+    {name: 'downloadGrant',type: 'boolean'},
+    {name: 'publishGrant', type: 'boolean'},
     {name: 'adminGrant',   type: 'boolean'}
 ]);