Beispiel #1
0
        public Task CreatePermissionAsync(PermissionInfo permissionInfo,
                                          CancellationToken cancellationToken = default(CancellationToken))
        {
            Ensure.ArgumentNotNull(permissionInfo, nameof(permissionInfo));

            return(PutAsync(
                       $"permissions/{SanitiseVhostName(permissionInfo.GetVirtualHostName())}/{permissionInfo.GetUserName()}",
                       permissionInfo, cancellationToken));
        }
Beispiel #2
0
        public void CreatePermission(PermissionInfo permissionInfo)
        {
            if (permissionInfo == null)
            {
                throw new ArgumentNullException("permissionInfo");
            }

            Put(string.Format("permissions/{0}/{1}",
                              permissionInfo.GetVirtualHostName(),
                              permissionInfo.GetUserName()),
                permissionInfo);
        }
Beispiel #3
0
 public void Should_return_the_correct_vhost_name()
 {
     permissionInfo.GetVirtualHostName().ShouldEqual(vhost.Name);
 }