mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
PHRAS-508_acl-cache
- wip
This commit is contained in:
@@ -32,23 +32,23 @@ class ACLManipulatorTest extends \PhraseanetTestCase
|
||||
$acl->set_masks_on_base($baseId, '1', '1', '1', '1');
|
||||
|
||||
$acl->update_rights_to_base($baseId, [
|
||||
'canputinalbum' => '0',
|
||||
'candwnldhd' => '0',
|
||||
\ACL::CANPUTINALBUM => '0',
|
||||
\ACL::CANDWNLDHD => '0',
|
||||
'candwnldsubdef' => '0',
|
||||
'nowatermark' => '0',
|
||||
'candwnldpreview' => '0',
|
||||
'cancmd' => '0',
|
||||
'canadmin' => '0',
|
||||
'canreport' => '0',
|
||||
'canpush' => '0',
|
||||
\ACL::NOWATERMARK => '0',
|
||||
\ACL::CANDWNLDPREVIEW => '0',
|
||||
\ACL::CANCMD => '0',
|
||||
\ACL::CANADMIN => '0',
|
||||
\ACL::CANREPORT => '0',
|
||||
\ACL::CANPUSH => '0',
|
||||
'creationdate' => '0',
|
||||
'canaddrecord' => '0',
|
||||
'canmodifrecord' => '0',
|
||||
'candeleterecord' => '0',
|
||||
'chgstatus' => '0',
|
||||
'imgtools' => '0',
|
||||
'manage' => '0',
|
||||
'modify_struct' => '0',
|
||||
\ACL::CANADDRECORD => '0',
|
||||
\ACL::CANMODIFRECORD => '0',
|
||||
\ACL::CANDELETERECORD => '0',
|
||||
\ACL::CHGSTATUS => '0',
|
||||
\ACL::IMGTOOLS => '0',
|
||||
\ACL::MANAGE => '0',
|
||||
\ACL::MODIFY_STRUCT => '0',
|
||||
'bas_modify_struct' => '0'
|
||||
]);
|
||||
|
||||
@@ -70,21 +70,21 @@ class ACLManipulatorTest extends \PhraseanetTestCase
|
||||
$this->assertTrue($acl->has_right_on_sbas($databoxId, 'bas_modif_th'));
|
||||
$this->assertTrue($acl->has_right_on_sbas($databoxId, 'bas_chupub'));
|
||||
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, 'canputinalbum'));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, 'candwnldhd'));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, 'nowatermark'));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, 'candwnldpreview'));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, 'cancmd'));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, 'canadmin'));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, 'canreport'));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, 'canpush'));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, 'canaddrecord'));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, 'canmodifrecord'));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, 'candeleterecord'));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, 'chgstatus'));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, 'imgtools'));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, 'manage'));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, 'modify_struct'));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, \ACL::CANPUTINALBUM));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, \ACL::CANDWNLDHD));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, \ACL::NOWATERMARK));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, \ACL::CANDWNLDPREVIEW));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, \ACL::CANCMD));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, \ACL::CANADMIN));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, \ACL::CANREPORT));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, \ACL::CANPUSH));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, \ACL::CANADDRECORD));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, \ACL::CANMODIFRECORD));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, \ACL::CANDELETERECORD));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, \ACL::CHGSTATUS));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, \ACL::IMGTOOLS));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, \ACL::MANAGE));
|
||||
$this->assertTrue($acl->has_right_on_base($baseId, \ACL::MODIFY_STRUCT));
|
||||
|
||||
$this->assertEquals(0, $acl->get_limits($baseId));
|
||||
$this->assertEquals(0, $acl->get_limits($acl->get_mask_xor($baseId)));
|
||||
|
@@ -40,11 +40,11 @@ class RegistrationManipulatorTest extends \PhraseanetTestCase
|
||||
$aclMock->expects($this->once())->method('give_access_to_sbas')->with($this->equalTo([self::$DI['collection']->get_sbas_id()]));
|
||||
$aclMock->expects($this->once())->method('give_access_to_base')->with($this->equalTo([self::$DI['collection']->get_base_id()]));
|
||||
$aclMock->expects($this->once())->method('update_rights_to_base')->with($this->equalTo(self::$DI['collection']->get_base_id()), $this->equalTo([
|
||||
'canputinalbum' => '1',
|
||||
'candwnldhd' => '1',
|
||||
'nowatermark' => '0',
|
||||
'candwnldpreview' => '1',
|
||||
'actif' => '1',
|
||||
\ACL::CANPUTINALBUM => '1',
|
||||
\ACL::CANDWNLDHD => '1',
|
||||
\ACL::NOWATERMARK => '0',
|
||||
\ACL::CANDWNLDPREVIEW => '1',
|
||||
\ACL::ACTIF => '1',
|
||||
]));
|
||||
|
||||
$aclProviderMock = $this->getMockBuilder('Alchemy\Phrasea\Authentication\ACLProvider')->disableOriginalConstructor()->getMock();
|
||||
|
Reference in New Issue
Block a user