示例#1
0
        public void Acl_RemoveRoles()
        {
            using (var httpTest = new HttpTest())
            {
                var mds = new MarketDataService(_cfg);

                var auth = new AuthorizationPath.Input()
                {
                    Path  = "",
                    Roles = new List <AuthorizationPrincipalRole>()
                    {
                        new AuthorizationPrincipalRole()
                        {
                            Role          = "Role",
                            InheritedFrom = "InheritedFrom",
                            Principal     = new Principal()
                            {
                                PrincipalId   = "Id",
                                PrincipalType = PrincipalType.User
                            }
                        }
                    }
                };

                mds.RemoveRoles(auth).ConfigureAwait(true).GetAwaiter().GetResult();

                httpTest.ShouldHaveCalledPath($"{_cfg.BaseAddress}v2.1/acl/roles")
                .WithVerb(HttpMethod.Delete)
                .WithContentType("application/x.msgpacklz4")
                .WithHeadersTest()
                .Times(1);
            }
        }
示例#2
0
        /// <summary>
        /// Remove a role from the ACL Path
        /// </summary>
        /// <param name="remove">The entity we want to remove. At the path remove.Path we remove the remove.Roles</param>
        /// <param name="ctk">CancellationToken</param>
        /// <returns></returns>
        public Task RemoveRoles(AuthorizationPath.Input remove, CancellationToken ctk = default)
        {
            var url = "/acl/roles";

            return(_client.Exec <AuthorizationPath.Input>(HttpMethod.Delete, url, remove));
        }
示例#3
0
        /// <summary>
        /// Add a role to the ACL Path
        /// </summary>
        /// <param name="add">The entity we want to add. At the path add.Path we add the add.Roles</param>
        /// <param name="ctk">CancellationToken</param>
        /// <returns></returns>
        public Task AddRoles(AuthorizationPath.Input add, CancellationToken ctk = default)
        {
            var url = "/acl/roles";

            return(_client.Exec <AuthorizationPath.Input>(HttpMethod.Post, url, add));
        }
示例#4
0
        /// <summary>
        /// Upsert the ACL Path Roles
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <param name="upsert">The entity we want to upsert</param>
        /// <param name="ctk">CancellationToken</param>
        /// <returns></returns>
        public Task UpsertRoles(AuthorizationPath.Input upsert, CancellationToken ctk = default)
        {
            var url = "/acl";

            return(_client.Exec <AuthorizationPath.Input>(HttpMethod.Post, url, upsert));
        }
示例#5
0
 public Task RemoveRoles(AuthorizationPath.Input remove, CancellationToken ctk = default)
 {
     throw new NotImplementedException();
 }
示例#6
0
 public Task UpsertRoles(AuthorizationPath.Input upsert, CancellationToken ctk = default)
 {
     throw new NotImplementedException();
 }