Get field to check for permission type for the given check.
Defaults to those provided by {@see InheritedPermissionsExtension)

@param string $type
@return string
168549
protected function getPermissionField($type)
    {
        switch ($type) {
            case self::DELETE:
                // Delete uses edit type - Drop through
            case self::EDIT:
                return 'CanEditType';
            case self::VIEW:
                return 'CanViewType';
            default:
                throw new InvalidArgumentException("Invalid argument type $type");
        }
    }
627395
public function getPermissionMap(ResourceType $type)
    {
        /** @var MaskDecoder[] $decoders */
        $decoders = $this->maskRepo->findBy(['resourceType' => $type]);
        $permsMap = [];

        foreach ($decoders as $decoder) {
            $permsMap[$decoder->getValue()] = $decoder->getName();
        }

        return $permsMap;
    }
484502
protected function getCustomType($type)
    {
        $root = $this;
        while ($cur = $root->getParent()) {
            $root = $cur;
        }
        $customTypes = $root->getSchema()->getCustomTypes();
        $type = ltrim($type, '&');

        if (isset($customTypes[$type])) {
            return $customTypes[$type];
        }

        throw new Exception("Unable to resolve '$type' to a custom type-definition.");
    }
1316415
public function getRolesByContentTypePermission($permissionName, $contenttype)
    {
        // Here's how it works:
        // - if a permission is granted through 'contenttype-all', it is effectively granted
        // - if a permission is granted through 'contenttypes/$contenttype', it is effectively granted
        // - if 'contenttypes/$contenttype/$permissionName' is not set, *and* the permission is granted through 'contenttype-default', it is effectively granted
        // - otherwise, the permission is denied
        $overrideRoles = $this->app['config']->get("permissions/contenttype-all/$permissionName");
        if (!is_array($overrideRoles)) {
            $overrideRoles = [];
        }
        $contenttypeRoles = $this->app['config']->get("permissions/contenttypes/$contenttype/$permissionName");
        if (!is_array($contenttypeRoles)) {
            $contenttypeRoles = $this->app['config']->get("permissions/contenttype-default/$permissionName");
        }
        if (!is_array($contenttypeRoles)) {
            $contenttypeRoles = [];
        }
        $effectiveRoles = array_unique(array_merge($overrideRoles, $contenttypeRoles));

        return $effectiveRoles;
    }
1062778
public function getXSDType($type)
    {
        if ($this->isXDSType($type)) {
            return self::$XSDTypes[strtolower($type)];
        } elseif ($type) {
            if (strpos($type, '[]')) {
                if ($this->isXDSType(str_replace('[]', '', $type))) {
                    return self::$XSDTypes['array'];
                }
            }

            return $this->addComplexType($type);
        } else {
            return null;
        }
    }
203064
public function withType(string $type): self
    {
        $this->type = UserPermissionEnum::ensureValid($type);
        return $this;
    }
502066
public function getTypeConfig($type = self::NORMAL, $default = [])
    {
        if ($this->isTypeAvailable($type)) {
            return $this->pageTypesAvailable[$type];
        }

        return $default;
    }
1024373
protected function checkPermission($type)
    {
        if (isset($this->config[$type]['visible'])) {
            $role = $this->config[$type]['visible'];
            unset($this->config[$type]['visible']);
            if (!Yii::$app->getUser()->can($role)) {
                return false;
            }
        }

        return true;
    }
564294
private function getAlias( $type ) {
		if ($this->fetchType) {
			$type = $this->fetchType;
			$this->fetchType = null;
		}
		return $type;
	}
398940
protected function dispatchString($permissions, $type = NULL, $context = NULL) {
    if('TRUE' === strtoupper($permissions)) {
      return $this->dispatchBoolean(TRUE, $type);
    }

    if('FALSE' === strtoupper($permissions)) {
      return $this->dispatchBoolean(FALSE, $type);
    }

    return $this->externalAccessCheck($permissions, $type, $context);
  }
321122
public static function getCheck($checkType)
    {
        $strReturn = "";

        if (array_key_exists($checkType, self::$checks)) {
            $strReturn = self::$checks[$checkType];
        }

        return $strReturn;
    }
30312
public function getProviderType(string $type): int
    {
        assert(isset($this->providerType[$type]));
        return $this->providerType[$type];
    }
653747
static public function getStorableType( $type )
    {
        switch ( $type )
        {
            case 'google':      return self::TYPE_GOOGLE;
            case 'facebook':    return self::TYPE_FACEBOOK;
            case 'yahoo':       return self::TYPE_YAHOO;
            case 'twitter':     return self::TYPE_TWITTER;
        }
    }
316799
public function get($objectType)
    {
        do {
            if (isset($this->permissionCollections[$objectType])) {
                return $this->permissionCollections[$objectType];
            }
            $actualObjectType = $objectType;
            $objectType = get_parent_class($objectType);
        } while ($objectType !== false);

        throw new InvalidArgumentException("No permissions for type $actualObjectType found.");
    }
506765
public static function getDefaultGroupVisibility($type) {
    $visibility = &drupal_static(__FUNCTION__ . $type);

    if (empty($visibility)) {
      switch ($type) {
        case 'closed_group':
          $visibility = 'group';
          break;

        case 'open_group':
          $visibility = 'community';
          break;

        case 'public_group':
          $visibility = 'public';
          break;

        default:
          $visibility = NULL;
      }

      \Drupal::moduleHandler()
        ->alter('social_group_default_visibility', $visibility, $type);
    }

    return $visibility;
  }
1081222
private static function check_type($type=null) {
	if (is_null($type)) {
		return self::TYPE_CONTINUOUS;
	}
	
	if (isset(self::$type_durations[$type]) == false) {
		$exception = bootstrap::get_library('exception');
		throw new $exception('unknown session type');
	}
	
	return $type;
}
283948
public function getHashingAlgorithm($type)
    {
        switch ($type) {
            case 'md5':
                return Password::MD5;

            case 'sha256':
                return Password::SHA256;

            case 'sha512':
                return Password::SHA512;

            case 'argon2':
                return Password::SODIUM_ARGON2;

            case 'scrypt':
                return Password::SODIUM_SCRYPT;

            case 'blowfish':
            case 'bf':
            default:
                return Password::BLOWFISH;
        }
    }