<commit_before><?php

/**
 * Class GeneController
 *
 * Contains the actions pertaining to genes
 */
class GeneController extends BaseModuleController
{
    public $layout = 'genetics';

    protected $itemsPerPage = 20;

    /**
     * Configure access rules
     *
     * @return array
     */
    public function accessRules()
    {
        return array(
            array('allow',
                'actions' => array('Edit'),
                'roles' => array('OprnEditGene'),
            ),
            array('allow',
                'actions' => array('List'),
                'roles' => array('OprnViewGene'),
            ),
        );
    }

    /**
     * @param bool $id
     *
     * @throws CHttpException
     * @throws Exception
     */
    public function actionEdit($id = false)
    {
        $admin = new Crud(PedigreeGene::model(), $this);
        if ($id) {
            $admin->setModelId($id);
        }

        $admin->setModelDisplayName('Gene');
        $admin->setEditFields(array(
            'name' => 'text',
            'location' => 'text',
            'priority' => 'checkbox',
            'description' => 'text',
            'details' => 'text',
            'refs' => 'text',
        ));

        $admin->editModel();
    }

    /**
     * List the Genetic Patients
     */
    public function actionList()
    {
        $admin = new Crud(PedigreeGene::model(), $this);
        $admin->setModelDisplayName('Gene');
        $admin->setListFields(array(
            'id',
            'name',
            'location'
        ));
        $admin->searchAll();
        $admin->getSearch()->setItemsPerPage($this->itemsPerPage);
        $admin->listModel();
    }

    /**
     * Deletes rows for the model.
     */
    public function actionDelete()
    {
        $admin = new Crud(PedigreeGene::model(), $this);
        $admin->deleteModel();
    }
}<commit_msg>Fixes delete permissions and adds description to list page<commit_after><?php

/**
 * Class GeneController
 *
 * Contains the actions pertaining to genes
 */
class GeneController extends BaseModuleController
{
    public $layout = 'genetics';

    protected $itemsPerPage = 20;

    /**
     * Configure access rules
     *
     * @return array
     */
    public function accessRules()
    {
        return array(
            array('allow',
                'actions' => array('Edit', 'Delete'),
                'roles' => array('OprnEditGene'),
            ),
            array('allow',
                'actions' => array('List'),
                'roles' => array('OprnViewGene'),
            ),
        );
    }

    /**
     * @param bool $id
     *
     * @throws CHttpException
     * @throws Exception
     */
    public function actionEdit($id = false)
    {
        $admin = new Crud(PedigreeGene::model(), $this);
        if ($id) {
            $admin->setModelId($id);
        }

        $admin->setModelDisplayName('Gene');
        $admin->setEditFields(array(
            'name' => 'text',
            'location' => 'text',
            'priority' => 'checkbox',
            'description' => 'text',
            'details' => 'text',
            'refs' => 'text',
        ));

        $admin->editModel();
    }

    /**
     * List the Genetic Patients
     */
    public function actionList()
    {
        $admin = new Crud(PedigreeGene::model(), $this);
        $admin->setModelDisplayName('Gene');
        $admin->setListFields(array(
            'id',
            'name',
            'location',
            'description',
        ));
        $admin->searchAll();
        $admin->getSearch()->setItemsPerPage($this->itemsPerPage);
        $admin->listModel();
    }

    /**
     * Deletes rows for the model.
     */
    public function actionDelete()
    {
        $admin = new Crud(PedigreeGene::model(), $this);
        $admin->deleteModel();
    }
}
{'fraction_non_alphanumeric': 0.15270935960591134, 'fraction_numerical': 0.0010370754472387865, 'mean_word_length': 1.6885017421602788, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 47, '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': '7657235', 'n_tokens_mistral': 1126, 'n_tokens_neox': 1075, 'n_words': 218}