static internal async Task setACL <T>(OpenChainSession ad, String assetPath, T acl) where T : class { var assetACL = await ad.GetData <T>(assetPath, "acl"); assetACL.Value = acl; await ad.SetData(assetACL); }
static internal async Task SetAdminACL(OpenChainSession ad, String CommunityHandle, String adminPubKey) { //set asset ACL await setACL(ad, getTreasuryPath(CommunityHandle), new[] { new { subjects = new [] { new { addresses = new[] { adminPubKey }, required = 1 } }, permissions = new { account_negative = "Permit", account_modify = "Permit" } } }); //set user ACL await setACL(ad, USERFOLDER, new[] { new { subjects = new [] { new { addresses = new String[] { adminPubKey }, required = 1 } }, permissions = (object)new { account_create = "Permit", account_modify = "Permit", account_spend = "Permit" } }, new { subjects = new [] { new { addresses = new String[] { }, required = 0 } }, permissions = (object)new { account_modify = "Permit" } }, }); }
static async Task updateLedgerInfo(OpenChainSession ad, Models.OCCommunityInfo community) { var ir = await ad.GetData <LedgerInfo>("/", "info"); ir.Value = new LedgerInfo { Name = community.full_name, TermsOfService = community.description }; await ad.SetData(ir); }
static async Task <T> getACL <T>(OpenChainSession ad, String assetPath, T format) where T : class { var assetACL = await ad.GetData <T>(assetPath, "acl"); return(assetACL.Value); }