PHP code example of kumwe / business-policy
1. Go to this page and download the library: Download kumwe/business-policy library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kumwe / business-policy example snippets
use Kumwe\BusinessPolicy\Policy\RecordPolicyConstant;
use Kumwe\BusinessPolicy\Policy\RecordPolicySchema;
use Kumwe\BusinessPolicy\Policy\RecordPolicySet;
use Kumwe\BusinessPolicy\Application\FieldAccessUsage;
use Kumwe\BusinessPolicy\Application\FieldDisclosurePlan;
$policy = new RecordPolicySet(new RecordPolicySchema([]), [new RecordPolicyConstant(true)]);
$fields = new FieldDisclosurePlan(['list' => ['name']]);
$policy->allows([]); // true: an allow matched and no deny matched
$fields->allows(FieldAccessUsage::Export, 'name'); // false: uses are independent