Skip to content

Commit

Permalink
Change how rules are created
Browse files Browse the repository at this point in the history
  • Loading branch information
nirinchev committed Nov 3, 2023
1 parent d066805 commit d5815a0
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions Tools/DeployApps/BaasClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Net;
Expand Down Expand Up @@ -418,27 +419,34 @@ private async Task<BaasApp> CreateFlxApp(string name)
{
_output.WriteLine($"Creating FLX app {name}...");

var (app, _) = await CreateAppCore(name, new
var (app, mongoServiceId) = await CreateAppCore(name, new
{
flexible_sync = new
{
state = "enabled",
database_name = $"FLX_{Differentiator}",
queryable_fields_names = new[] { "Int64Property", "GuidProperty", "DoubleProperty", "Int", "Guid", "Id", "PartitionLike" },
permissions = new
}
});

await PostAsync<BsonDocument>($"groups/{_groupId}/apps/{app}/services/{mongoServiceId}/default_rule", new
{
roles = new[]
{
new
{
rules = new { },
defaultRoles = new[]
name = "all",
apply_when = new { },
read = true,
write = true,
insert = true,
delete = true,
document_filters = new
{
new
{
name = "all",
applyWhen = new { },
read = true,
write = true,
}
read = true,
write = true,
}
},
}
}
});

Expand Down

0 comments on commit d5815a0

Please sign in to comment.