private void SecureSampleDB(SecureDatabase db) { SecurityPermissions security = db.Security(sampleTableName); security.RestrictedColumns.Add(SecurityIdentity.Create(IdentityScope.Group, "G1"), new List <string>(new string[] { "SecretOwner" })); security.RestrictedColumns.Add(SecurityIdentity.Create(IdentityScope.Group, "G2"), new List <string>(new string[] { "SecretPriority" })); security.RowRestrictedUsers.Add(SecurityIdentity.Create(IdentityScope.Group, "G3"), "SecretPriority > 1"); security.RowRestrictedUsers.Add(SecurityIdentity.Create(IdentityScope.Group, "G4"), "SecretPriority > 2"); }
private static void GetSettings(string tableName, string settingsJsonPath) { Console.WriteLine("Reading settings from '{0}' and writing to '{1}'...", tableName, settingsJsonPath); CombinedSettings settings = new CombinedSettings(); SecureDatabase db = new SecureDatabase(); settings.Security = db.Security(tableName); Table t = db[tableName]; settings.ItemCountLimit = t.PartitionCount * ushort.MaxValue; settings.Schema = new List <ColumnDetails>(t.ColumnDetails); string settingsJson = JsonConvert.SerializeObject(settings, serializerSettings); File.WriteAllText(settingsJsonPath, settingsJson); }