Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@MikeGoldsmith
Created May 8, 2018 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MikeGoldsmith/585df260f151c7a87065869d04da0c81 to your computer and use it in GitHub Desktop.
Save MikeGoldsmith/585df260f151c7a87065869d04da0c81 to your computer and use it in GitHub Desktop.
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