<commit_before><?php

class m160727_193640_add_authitems extends CDbMigration
{
	private $authitems = array(
		array('name' => 'Clinical CVI', 'type' => 2),
		array('name' => 'Clerical CVI', 'type' => 2),
		array('name' => 'TaskClinicalCvi', 'type' => 1),
		array('name' => 'TaskClericalCvi', 'type' => 1),
		array('name' => 'OprnCreateCvi', 'type' => 0, 'bizrule' => 'OphCoCvi.canCreateOphCoCvi'),
		array('name' => 'OprnEditCvi', 'type' => 0, 'bizrule' => 'OphCoCvi.canEditOphCoCvi'),
		array('name' => 'OprnEditClinicalCvi', 'type' => 0, 'bizrule' => 'OphCoCvi.canEditClinicalOphCoCvi'),
		array('name' => 'OprnEditClinicalCviExplicit', 'type' => 0),
		array('name' => 'OprnEditClericalCvi', 'type' => 0),
		array('name' => 'OprnPatientSignatureCvi', 'type' => 0),
		array('name' => 'OprnConsultantSignatureCvi', 'type' => 0),
		array('name' => 'OprnCompleteCvi', 'type' => 0)
	);

	private $parents = array(
		'OprnCreateCvi' => 'User',
		'OprnCreateCvi' => 'User',
		'OprnEditClericalCvi' => 'TaskClericalCvi',
		'OprnPatientSignatureCvi' => 'TaskClericalCvi',
		'OprnCompleteCvi' => 'TaskClericalCvi',
		'OprnEditClinicalCviExplicit' => 'TaskClinicalCvi',
		'OprnPatientSignatureCvi' => 'TaskClinicalCvi',
		'OprnConsultantSignatureCvi' => 'TaskClinicalCvi',
		'TaskClinicalCvi' => 'Clinical CVI',
		'TaskClericalCvi' => 'Clerical CVI'
	);

	public function up()
	{
		foreach ($this->authitems as $authitem) {<commit_msg>+ [OE-6118] hierarchy tweaks for biz rule operations<commit_after><?php

class m160727_193640_add_authitems extends CDbMigration
{
	private $authitems = array(
		array('name' => 'Clinical CVI', 'type' => 2),
		array('name' => 'Clerical CVI', 'type' => 2),
		array('name' => 'TaskClinicalCvi', 'type' => 1),
		array('name' => 'TaskClericalCvi', 'type' => 1),
		array('name' => 'OprnCreateCvi', 'type' => 0, 'bizrule' => 'OphCoCvi.canCreateOphCoCvi'),
		array('name' => 'OprnEditCvi', 'type' => 0, 'bizrule' => 'OphCoCvi.canEditOphCoCvi'),
		array('name' => 'OprnEditClinicalCvi', 'type' => 0, 'bizrule' => 'OphCoCvi.canEditClinicalOphCoCvi'),
		array('name' => 'OprnEditClinicalCviExplicit', 'type' => 0),
		array('name' => 'OprnEditClericalCvi', 'type' => 0),
		array('name' => 'OprnPatientSignatureCvi', 'type' => 0),
		array('name' => 'OprnConsultantSignatureCvi', 'type' => 0),
		array('name' => 'OprnCompleteCvi', 'type' => 0)
	);

	private $parents = array(
		// These must be set under a role that any logged in user must have, as just receiving true from the bizrule
		// is insufficient if the user does not have a specific authitem assigned to them that is a parent of it.
		'OprnCreateCvi' => 'User',
		'OprnEditCvi' => 'User',
		'OprnEditClinicalCvi' => 'User',
		// general hierarchy
		'OprnEditClericalCvi' => 'TaskClericalCvi',
		'OprnPatientSignatureCvi' => 'TaskClericalCvi',
		'OprnCompleteCvi' => 'TaskClericalCvi',
		'OprnEditClinicalCviExplicit' => 'TaskClinicalCvi',
		'OprnPatientSignatureCvi' => 'TaskClinicalCvi',
		'OprnConsultantSignatureCvi' => 'TaskClinicalCvi',
		'TaskClinicalCvi' => 'Clinical CVI',
		'TaskClericalCvi' => 'Clerical CVI'
	);

	public function up()
	{
		foreach ($this->authitems as $authitem) {
{'fraction_non_alphanumeric': 0.1865530303030303, 'fraction_numerical': 0.016414141414141416, 'mean_word_length': 5.756929637526652, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 80, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3859693', 'n_tokens_mistral': 1387, 'n_tokens_neox': 1236, 'n_words': 244}