コード例 #1
0
        public async Task <IActionResult> EditUserRights([FromBody] EditUserRightsRequest request)
        {
            var result = _securityService.EditUserRights(request.UserId, request.RoleIds,
                                                         request.FunctionIds, request.AccessedRightsIds, request.DeniedRightsIds);

            return(Ok(await result));
        }
コード例 #2
0
        public async Task EditUserRightsRights()
        {
            var id   = _dbFaker.UserRights.FirstOrDefault().UserId;
            var rIds = _dbFaker.Roles.Take(3).Select(l => l.Id).ToArray();
            var fIds = _dbFaker.Functions.Skip(3).Take(3).Select(l => l.Id).ToArray();
            var aIds = _dbFaker.AccessRights.Take(3).Select(l => l.Id).ToArray();
            var dIds = _dbFaker.AccessRights.Skip(3).Take(3).Select(l => l.Id).ToArray();

            var response = await _securityData.EditUserRights(id, rIds, fIds, aIds, dIds);

            Assert.AreEqual(ActionStatus.Success, response.Status, response.Message);
            _mock.Verify(data => data.EditUserRights(id, rIds, fIds, aIds, dIds), () => Times.Exactly(1));
        }
コード例 #3
0
 public async Task ConsumeAsync(UserDeletedMessage message)
 {
     await m_service.EditUserRights(message.UserId, new int[0], new int[0], new int[0], new int[0]);
 }