public async Task <List <SalaryRateRequestResponse> > GetAssignedUsers( [FromServices] IManagementAreaService managementAreaService) { var usersId = await managementAreaService.GetAvailableUsersIdForManager(this.GetUserId()); return(await _rateRequestService.GetSalaryRateRequestsForUsers(usersId.ToArray())); }
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)); }
public ManagementAreaController([FromServices] IManagementAreaService managementAreaService) { _managementAreaService = managementAreaService; }