public void Cannot_execute_PlayerCommands_without_permissions()
        {
            // Arrange
            LogWithNewAdmin(Modules.PlayerManager, Permissions.View);

            // Act
            Assert.Throws <InsufficientPermissionsException>(() => _playerCommands.Edit(new EditPlayerData()));
            Assert.Throws <InsufficientPermissionsException>(() => _playerCommands.ChangePlayerVipLevel(new Guid(), new Guid()));
            Assert.Throws <InsufficientPermissionsException>(() => _playerCommands.AssignVip(new Core.Common.Data.Player.Player(), new VipLevel()));
            Assert.Throws <InsufficientPermissionsException>(() => _playerCommands.SetStatus(new Guid(), true));
            Assert.Throws <InsufficientPermissionsException>(() => _playerCommands.Register(new RegistrationData()));
            Assert.Throws <InsufficientPermissionsException>(() => _playerCommands.ChangeVipLevel(new Guid(), new Guid(), "Some remark"));
        }
예제 #2
0
        public string DeactivateVipLevel(Guid id, string remark, Guid?newVipLevelId)
        {
            _brandCommands.DeactivateVipLevel(id, remark, newVipLevelId);
            if (newVipLevelId != null)
            {
                _playerCommands.ChangePlayerVipLevel(id, newVipLevelId);
            }

            return(SerializeJson(new { Result = "success" }));
        }