コード例 #1
0
 /**
  * Resets admin rights on a collection.
  *
  * @param \ACL        $acl
  * @param \collection $collection
  */
 private function doResetRightsOnCollection(\ACL $acl, \collection $collection)
 {
     $baseId = $collection->get_base_id();
     $acl->set_limits($baseId, false);
     $acl->remove_quotas_on_base($baseId);
     $acl->set_masks_on_base($baseId, '0', '0', '0', '0');
     $acl->update_rights_to_base($baseId, ['canputinalbum' => '1', 'candwnldhd' => '1', 'candwnldsubdef' => '1', 'nowatermark' => '1', 'candwnldpreview' => '1', 'cancmd' => '1', 'canadmin' => '1', 'canreport' => '1', 'canpush' => '1', 'creationdate' => '1', 'canaddrecord' => '1', 'canmodifrecord' => '1', 'candeleterecord' => '1', 'chgstatus' => '1', 'imgtools' => '1', 'manage' => '1', 'modify_struct' => '1', 'bas_modify_struct' => '1']);
 }
コード例 #2
0
ファイル: ACLTest.php プロジェクト: nlegoff/Phraseanet
 public function testRemove_remaining()
 {
     $base_id = self::$DI['collection']->get_base_id();
     $droits = 50;
     $restes = 40;
     self::$object->give_access_to_base([$base_id]);
     self::$object->set_quotas_on_base($base_id, $droits, $restes);
     $this->assertEquals(40, self::$object->remaining_download($base_id));
     self::$object->remove_remaining($base_id, 1);
     $this->assertEquals(39, self::$object->remaining_download($base_id));
     self::$object->remove_remaining($base_id, 10);
     $this->assertEquals(29, self::$object->remaining_download($base_id));
     self::$object->remove_remaining($base_id, 100);
     $this->assertEquals(0, self::$object->remaining_download($base_id));
     self::$object->remove_quotas_on_base($base_id);
     $this->assertFalse(self::$object->is_restricted_download($base_id));
 }