Created
May 8, 2018 12:27
-
-
Save MikeGoldsmith/585df260f151c7a87065869d04da0c81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using Couchbase; | |
using Couchbase.Configuration.Client; | |
using Couchbase.Management; | |
namespace UserManagerUpsert_FullBucketAccess | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var cluster = new Cluster(new ClientConfiguration | |
{ | |
Servers = new List<Uri> { new Uri("http://10.112.170.101") } | |
}); | |
cluster.Authenticate("Administrator", "password"); | |
var clusterManager = cluster.CreateManager(); | |
var result = clusterManager.UpsertUser( | |
AuthenticationDomain.Local, | |
"test_user", | |
"secure123", | |
null, | |
new Role { Name = "bucket_admin", BucketName = "*" } | |
); | |
Console.WriteLine($"Success: {result.Success}"); | |
Console.ReadKey(true); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment