예제 #1
0
        public async Task <List <SalaryRateRequestResponse> > GetAssignedUsers(
            [FromServices] IManagementAreaService managementAreaService)
        {
            var usersId = await managementAreaService.GetAvailableUsersIdForManager(this.GetUserId());

            return(await _rateRequestService.GetSalaryRateRequestsForUsers(usersId.ToArray()));
        }
예제 #2
0
        public async Task <UserInfoResponse> ModifyUser([FromBody] UpdateUserInfoRequest request, [FromRoute] int userId,
                                                        [FromServices] IManagementAreaService managementAreaService)
        {
            if (User.IsInRole("Manager"))
            {
                var users = await managementAreaService.GetAvailableUsersIdForManager(this.GetUserId());

                if (!users.Contains(userId))
                {
                    Response.StatusCode = 403;
                    return(null);
                }
            }

            return(await _accountService.ModifyUser(request, userId));
        }
예제 #3
0
 public ManagementAreaController([FromServices] IManagementAreaService managementAreaService)
 {
     _managementAreaService = managementAreaService;
 }