Files
SGF/scripts/sgf-multiline-invoice-profile-readonly.php
2026-11-11 15:04:01 +02:00

3 lines
750 B
PHP

<?php
require __DIR__.'/sgf-single-bootstrap.php';$profiles=json_decode(file_get_contents($s['root'].'/single-profiles.json'),true)['profiles'];$names=['commercial_prepare','commercial_review','finance_prepare','finance_review','accounting_prepare','accounting_review','read_only'];$out=[];foreach($names as$n){$id=$profiles[$n]['user_id'];$out[$n]=['id'=>$id,'rights'=>$host->table('permission_grants')->where(['user_id'=>$id,'tenant_id'=>1,'company_id'=>2])->whereIn('permission',['service_fiscal.calculate','services.create','service_drafts.create','billing_drafts.create','billing_drafts.view','draft_documents.edit','service_invoices.issue','fiscal_rules.view'])->get(['permission','unit_id'])->all()];}echo json_encode($out,JSON_PRETTY_PRINT);