public async Task <IHttpActionResult> GetProjectRolesAsync(int projectId) { await _privilegesManager.DemandAny(Session.UserId, projectId, InstanceAdminPrivileges.AccessAllProjectsAdmin, ProjectAdminPrivileges.ViewGroupsAndRoles); var result = await _instanceRepository.GetProjectRolesAsync(projectId); return(Ok(result)); }
public async Task <IHttpActionResult> GetProjectGroupsAsync(int projectId, [FromUri] Pagination pagination, [FromUri] Sorting sorting, string search = null) { pagination.Validate(); SearchFieldValidator.Validate(search); await _privilegesManager.DemandAny(Session.UserId, projectId, InstanceAdminPrivileges.AccessAllProjectsAdmin, ProjectAdminPrivileges.ViewGroupsAndRoles); var tabularData = new TabularData { Pagination = pagination, Sorting = sorting, Search = search }; var result = await _groupRepository.GetProjectGroupsAsync(projectId, tabularData, SortingHelper.SortProjectGroups); return(Ok(result)); }