protected function checkPermission(array $prepared, $permission)
    {
        if (array_key_exists($permission, $prepared) && $prepared[$permission] === true) {
            return true;
        }

        $permission = (string) $permission;

        foreach ($prepared as $key => $value) {
            $key = (string) $key;

            if ((str_is($permission, $key) || str_is($key, $permission)) && $value === true) {
                return true;
            }
        }

        return false;
    }