5 lines
1.1 KiB
PHP
5 lines
1.1 KiB
PHP
<?php
|
|
$book=$argv[1]??'regression';require __DIR__.'/sgf-single-bootstrap.php';$p=json_decode(file_get_contents($repo.'/docs/integration/sgf-iva-assessment-access-proposal.json'),true);if($p['approved']!==false||$p['applied']!==false||count($p['new_right_names'])!==6||count($p['grants_per_book'])!==14)throw new LogicException('Unexpected proposed scope');
|
|
$existing=$host->table('permission_grants')->where(['tenant_id'=>1,'company_id'=>2,'unit_id'=>2])->whereIn('permission',$p['new_right_names'])->count();if($existing!==0)throw new LogicException('Proposed rights already present; reconcile before asking');foreach([13,14,15,16,17]as$id)if(!$host->table('company_memberships')->where(['tenant_id'=>1,'company_id'=>2,'user_id'=>$id])->exists())throw new LogicException('Proposed identity not existing');
|
|
file_put_contents($work.'/fiscal-next-access-readonly.json',json_encode(['passed'=>true,'proposed_rights'=>6,'proposed_grants'=>14,'existing_proposed_grants'=>0,'all_recipients_exist'=>true,'grants_applied'=>0,'new_demo'=>false],JSON_PRETTY_PRINT));echo json_encode(['passed'=>true,'book'=>$book,'proof'=>$work.'/fiscal-next-access-readonly.json']).PHP_EOL;
|