Retrieve the array of possible consentCODEs to use for responses by the survey system
The mapping of actual consents to consentCODEs is done in the gems__consents table

@return array Default consent codes are 'do not use' and 'consent given'
197136
public function getConsentTypes()
    {
        if (isset($this->project->consentTypes)) {
            $consentTypes = explode('|', $this->project->consentTypes);
        } else {
            $consentTypes = array('do not use', 'consent given');
        }

        return array_combine($consentTypes, $consentTypes);
    }
538481
public function getMappedAttributes()
    {
        $mappedArrayForApiRequest = [];
        $requestAttributes = $this->request->getData();
        foreach ($requestAttributes as $key => $value) {
            if (array_key_exists($key, $this->mappingRequestToOtherRequestAttributes)) {
                $mappedArrayForApiRequest[$this->mappingRequestToOtherRequestAttributes[$key]] = $value;
            }
        }

        return $mappedArrayForApiRequest;
    }
20763
public function getUnansweredTokenDeletionCodes()
    {
        $select = $this->_getDeletionCodeSelect();
        $select->where('grc_for_surveys = ?', self::APPLY_DO)
                ->where('grc_redo_survey = ?', self::REDO_NONE);

        return $this->_translateAndSort($this->db->fetchPairs($select));
    }
178935
public function getConsent($description)
    {
        static $codes = array();

        if (! isset($codes[$description])) {
            $codes[$description] = $this->_loadClass('consentCode', true, array($description));
        }

        return $codes[$description];
    }
1120735
public function getSchemaDataDefaults()
    {
        $data = parent::getSchemaDataDefaults();

        $sourceRecord = $this->getSourceRecord();

        $data['data'] = array_merge($data['data'], [
            'recordId' => $sourceRecord ? $sourceRecord->ID : null,
            'recordClass' => $sourceRecord ? $sourceRecord->ClassName : null,
            'contextKey' => $this->getContextKey(),
            'isPreviewable' => $this->getPreviewEnabled(),
            'limit' => $this->config()->get('default_page_size'),
            'offset' => 0,
            'page' => 0,
        ]);

        return $data;
    }
1070211
private function getPermissionArray()
    {
        $permissionArray = array(
            'can_add'           => false,
            'subtree_limit'     => $this->Attribute->contentClassAttribute()->attribute( eZTagsType::SUBTREE_LIMIT_FIELD ),
            'allowed_locations' => array(),
            'allowed_locations_tags' => false );

        $userLimitations = eZTagsTemplateFunctions::getSimplifiedUserAccess( 'tags', 'add' );

        if ( $userLimitations['accessWord'] == 'no' )
            return $permissionArray;

        $userLimitations = isset( $userLimitations['simplifiedLimitations']['Tag'] ) ? $userLimitations['simplifiedLimitations']['Tag'] : array();
        $limitTag = eZTagsObject::fetchWithMainTranslation( $permissionArray['subtree_limit'] );

        if ( empty( $userLimitations ) )
        {
            if ( $permissionArray['subtree_limit'] == 0 || $limitTag instanceof eZTagsObject )
            {
                $permissionArray['allowed_locations'] = array( $permissionArray['subtree_limit'] );

                if ( $limitTag instanceof eZTagsObject )
                    $permissionArray['allowed_locations_tags'] = array( $limitTag );
            }
        }
        else if ( $permissionArray['subtree_limit'] == 0 )
        {
            $permissionArray['allowed_locations_tags'] = array();

            /** @var eZTagsObject[] $userLimitations */
            $userLimitations = eZTagsObject::fetchList( array( 'id' => array( $userLimitations ) ), null, null, true );
            if ( is_array( $userLimitations ) && !empty( $userLimitations ) )
            {
                foreach ( $userLimitations as $limitation )
                {
                    $permissionArray['allowed_locations'][] = $limitation->attribute( 'id' );
                    $permissionArray['allowed_locations_tags'][] = $limitation;
                }
            }
        }
        else if ( $limitTag instanceof eZTagsObject )
        {
            /** @var eZTagsObject[] $userLimitations */
            $userLimitations = eZTagsObject::fetchList( array( 'id' => array( $userLimitations ) ), null, null, true );
            if ( is_array( $userLimitations ) && !empty( $userLimitations ) )
            {
                $pathString = $limitTag->attribute( 'path_string' );
                foreach ( $userLimitations as $limitation )
                {
                    if ( strpos( $pathString, '/' . $limitation->attribute( 'id' ) . '/' ) !== false )
                    {
                        $permissionArray['allowed_locations'] = array( $permissionArray['subtree_limit'] );
                        $permissionArray['allowed_locations_tags'] = array( $limitTag );
                        break;
                    }
                }
            }
        }

        if ( !empty( $permissionArray['allowed_locations'] ) )
            $permissionArray['can_add'] = true;

        return $permissionArray;
    }
576184
public function getRoundDefaults()
    {
        $this->_ensureRounds();

        if ($this->_rounds) {
            $defaults = end($this->_rounds);
            unset($defaults['gro_id_round'], $defaults['gro_id_survey']);

            $defaults['gro_id_order'] = $defaults['gro_id_order'] + 10;
        } else {
            // Rest of defaults come form model
            $defaults = array('gro_id_track' => $this->_trackId);
        }

        return $defaults;
    }
798993
protected function _getKeys() {
        $keys = $this->Permissions->schema()->columns();
        $newKeys = array();
        foreach ($keys as $key) {
            if (!in_array($key, array('id', 'aro_id', 'aco_id'))) {
                $newKeys[] = $key;
            }
        }
        return $newKeys;
    }
1353299
public function get_array() {
	$response = array();
	
	// links
	if ($this->links) {
		$response['links'] = $this->links;
	}
	
	// primary data
	$response['data'] = array(
		'type' => $this->primary_type,
	);
	if ($this->primary_id) {
		$response['data']['id'] = $this->primary_id;
	}
	if ($this->primary_attributes) {
		$response['data']['attributes'] = $this->primary_attributes;
	}
	if ($this->primary_relationships) {
		$response['data']['relationships'] = $this->primary_relationships;
	}
	if ($this->primary_links) {
		$response['data']['links'] = $this->primary_links;
	}
	if ($this->primary_meta_data) {
		$response['data']['meta'] = $this->primary_meta_data;
	}
	
	// included resources
	if ($this->included_data) {
		$response['included'] = array_values($this->included_data);
	}
	
	// meta data
	if ($this->meta_data) {
		$response['meta'] = $this->meta_data;
	}
	
	return $response;
}
377491
public function getTextRegistry()
    {
        return array(
            'Assign administrator' => __('Assign administrator'),
            'Assign proctors' => __('Assign proctors'),
            'Please select one or more test site to manage proctors' => __('Please select one or more test site to manage proctors'),
            'Create Proctor' => __('Create Proctor'),
            'Create and authorize a proctor to the selected test sites' => __('Create and authorize a proctor to the selected test sites'),
            'Manage Proctors' => __('Manage Proctors'),
            'Define sub-centers' => __('Define sub-centers'),
            'The proctors will be authorized. Continue ?' => __('The proctors will be authorized. Continue ?'),
            'The proctors will be revoked. Continue ?' => __('The proctors will be revoked. Continue ?'),
            'The proctor will be authorized. Continue ?' => __('The proctor will be authorized. Continue ?'),
            'The proctor will be revoked. Continue ?' => __('The proctor will be revoked. Continue ?'),
            'Authorized proctors' => __('Authorized proctors'),
            'Partially authorized proctors' => __('Partially authorized proctors'),
            'No assigned proctors' => __('No assigned proctors'),
            'Assigned proctors' => __('Assigned proctors'),
            'Creates and authorizes proctor' => __('Creates and authorizes proctor'),
            'Authorize the selected proctors' => __('Authorize the selected proctors'),
            'Authorize the proctor' => __('Authorize the proctor'),
            'Revoke authorization for the selected proctors' => __('Revoke authorization for the selected proctor'),
            'Revoke the proctor' => __('Revoke the proctor'),
            'Proctors authorized' => __('Proctors authorized'),
            'Proctors revoked' => __('Proctors revoked'),
            'Proctor created' => __('Proctor created'),
            'No proctors in request param' => __('No proctors in request param'),
            'Test site %s' =>__('Test site %s'),
            'Test center saved' => __('Test center saved'),
            'Edit test center' => __('Edit test center')
        );
    }
6713
public function permissions()
    {
        if (is_array($this->permissions)) {
            return $this->permissions;
        }

        if ($this->permissions) {
            return [ $this->permissions ];
        }

        return [];
    }
1156565
public static function permissions(): array
    {
        $permissions = parent::permissions();

        //  Fetch the blogs, each blog should have its own admin nav grouping
        $ci =& get_instance();
        $ci->load->model('blog/blog_model');
        $blogs = $ci->blog_model->getAll();

        $out = array();

        if (!empty($blogs)) {

            foreach ($blogs as $blog) {

                $permissions[$blog->id . ':manage']  = $blog->label . ': Can manage categories';
                $permissions[$blog->id . ':create']  = $blog->label . ': Can create categories';
                $permissions[$blog->id . ':edit']    = $blog->label . ': Can edit categories';
                $permissions[$blog->id . ':delete']  = $blog->label . ': Can delete categories';
            }
        }

        return $permissions;
    }
686933
public static function get_declared_permissions_list()
    {
        if (!self::$declared_permissions) {
            return null;
        }

        if (self::$declared_permissions_list) {
            return self::$declared_permissions_list;
        }

        self::$declared_permissions_list = array();

        self::traverse_declared_permissions(self::$declared_permissions, self::$declared_permissions_list);

        return self::$declared_permissions_list;
    }
979320
protected function getRequesters() {
        $mapParentId = array();
        $mapAroId = array();

        $aros = $this->Aro->getAll();
        $permissions = $this->Permission->getAll();

        // Map ACOs to AROs indexed by IDs
        foreach ($permissions as $permission) {
            $permission = $permission['ObjectPermission'];

            $mapAroId[$permission['aro_id']][$permission['aco_id']] = $permission;
        }

        // Map IDs to parent IDs
        foreach ($aros as $aro) {
            $mapParentId[$aro['RequestObject']['id']] = $aro['RequestObject'];
        }

        // Loop through AROs and determine permissions
        // While taking into account inheritance
        foreach ($aros as &$aro) {
            $id = $aro['RequestObject']['id'];
            $parent_id = $aro['RequestObject']['parent_id'];
            $inheritance = array();

            while (isset($mapParentId[$parent_id])) {
                array_unshift($inheritance, $parent_id);
                $parent_id = $mapParentId[$parent_id]['parent_id'];
            }

            $inheritance[] = $id;

            // Fetch permissions from parents
            $perms = array();
            $parent_id = $aro['RequestObject']['parent_id']; // reset $parent_id

            foreach ($inheritance as $pid) {
                if (isset($mapAroId[$pid])) {
                    $perms = Hash::merge($perms, array_map(function($value) use ($id, $parent_id) {

                        // If the ARO on the permission doesn't match the current ARO
                        // It is being inherited, so force it to 0
                        if ($id != $value['aro_id']) {
                            $value = array_merge($value, array(
                                '_create' => 0,
                                '_read' => 0,
                                '_update' => 0,
                                '_delete' => 0
                            ));

                        // Top level AROs cant inherit from nothing
                        // So change those values to denied
                        } else if (empty($parent_id)) {
                            foreach (array('_create', '_read', '_update', '_delete') as $action) {
                                if ($value[$action] == 0) {
                                    $value[$action] = -1;
                                }
                            }
                        }

                        return $value;
                    }, $mapAroId[$pid]));
                }
            }

            $aro['ObjectPermission'] = $perms;
        }

        return $aros;
    }
272210
public function getPermissionsIdList() {

		$permissions		= $this->permissionMappingList;
		$permissionsList	= [];

		foreach ( $permissions as $permission ) {

			array_push( $permissionsList, $permission->permissionId );
		}

		return $permissionsList;
	}
755030
public function getDefaultEntities()
    {
        return [
            'blog_category' => [
                'entity_model' => 'Mirasvit\Blog\Model\ResourceModel\Category',
                'table'        => 'mst_blog_category_entity',
                'attributes'   => [
                    'name' => [
                        'type'   => 'varchar',
                        'label'  => 'Name',
                        'input'  => 'text',
                        'global' => ScopedAttributeInterface::SCOPE_STORE,
                    ],

                    'url_key' => [
                        'type'   => 'varchar',
                        'label'  => 'Url Key',
                        'input'  => 'text',
                        'global' => ScopedAttributeInterface::SCOPE_STORE,
                    ],

                    'status' => [
                        'type'   => 'int',
                        'label'  => 'Status',
                        'input'  => 'select',
                        'source' => 'Magento\Eav\Model\Entity\Attribute\Source\Boolean',
                        'global' => ScopedAttributeInterface::SCOPE_WEBSITE,
                    ],

                    'content' => [
                        'type'   => 'text',
                        'label'  => 'Content',
                        'input'  => 'textarea',
                        'global' => ScopedAttributeInterface::SCOPE_STORE,
                    ],

                    'meta_title'       => [
                        'type'   => 'varchar',
                        'label'  => 'Meta Title',
                        'input'  => 'text',
                        'global' => ScopedAttributeInterface::SCOPE_STORE,
                    ],
                    'meta_keywords'    => [
                        'type'   => 'text',
                        'label'  => 'Meta Keywords',
                        'input'  => 'textarea',
                        'global' => ScopedAttributeInterface::SCOPE_STORE,
                    ],
                    'meta_description' => [
                        'type'   => 'varchar',
                        'label'  => 'Meta Description',
                        'input'  => 'textarea',
                        'global' => ScopedAttributeInterface::SCOPE_STORE,
                    ],
                ],
            ],
        ];
    }
509483
public function providePermissions()
    {
        return array(
            'REFUND_PAYMENTS' => array(
                'name' => _t('SilverStripe\Omnipay\Model\Payment.PERMISSION_REFUND_PAYMENTS', 'Refund payments'),
                'help' => _t(
                    'SilverStripe\Omnipay\Model\Payment.PERMISSION_REFUND_PAYMENTS_HELP',
                    'Allow refunding of captured payments'
                ),
                'category' => _t('SilverStripe\Omnipay\Model\Payment.PAYMENT_PERMISSIONS', 'Payment actions'),
                'sort' => 200
            ),
            'CAPTURE_PAYMENTS' => array(
                'name' => _t('SilverStripe\Omnipay\Model\Payment.PERMISSION_CAPTURE_PAYMENTS', 'Capture payments'),
                'help' => _t(
                    'SilverStripe\Omnipay\Model\Payment.PERMISSION_CAPTURE_PAYMENTS_HELP',
                    'Allow capturing of authorized payments'
                ),
                'category' => _t('SilverStripe\Omnipay\Model\Payment.PAYMENT_PERMISSIONS', 'Payment actions'),
                'sort' => 200
            ),
            'VOID_PAYMENTS' => array(
                'name' => _t('SilverStripe\Omnipay\Model\Payment.PERMISSION_VOID_PAYMENTS', 'Void payments'),
                'help' => _t(
                    'SilverStripe\Omnipay\Model\Payment.PERMISSION_VOID_PAYMENTS_HELP',
                    'Allow voiding of authorized payments'
                ),
                'category' => _t('SilverStripe\Omnipay\Model\Payment.PAYMENT_PERMISSIONS', 'Payment actions'),
                'sort' => 200
            )
        );
    }