コード例 #1
0
 public function testAddParicipantAndHaveParticipantRemoveSelf()
 {
     return;
     //Turn on once issue is fixed with SECURITY_OPTIMIZED and this bug.
     $super = User::getByUsername('super');
     Yii::app()->user->userModel = $super;
     $fileModel = ZurmoTestHelper::createFileModel();
     $accounts = Account::getByName('anAccount');
     $steven = UserTestHelper::createBasicUser('steven');
     $conversation = new Conversation();
     $conversation->owner = $super;
     $conversation->subject = 'My test subject';
     $conversation->description = 'My test description';
     $this->assertTrue($conversation->save());
     $sally = UserTestHelper::createBasicUser('sally');
     $conversation->addPermissions($sally, Permission::READ_WRITE_CHANGE_PERMISSIONS_CHANGE_OWNER);
     $conversation->save();
     //Log in as sally, and remove her permission
     Yii::app()->user->userModel = $sally;
     //Breaks because SecurableItem 2 spots using SECURITY_OPTIMIZATION == false, think it is the first spot
     //todo: fix.
     $conversation->removePermissions(Yii::app()->user->userModel, Permission::READ_WRITE_CHANGE_PERMISSIONS_CHANGE_OWNER, Permission::ALLOW);
 }