public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { //Post and return to the page return(Page()); } // we need the resource group for updating the capacity later in the // create process and the pbi capacity api does not return a resource group var pbiCapacities = await _capacityService.ListAsync(); // The user will need to have access to the capacity in Azure and be a dedicated capacity admin var pbiCapacity = pbiCapacities.Where(x => x.Name == Workspace.CapacityName).SingleOrDefault(); if (pbiCapacity == null) { //Post and return to the page return(Page()); } //var resourceIdParts = Utils.ParseAzureResourceId(pbiCapacity.Id.ToString()); //var resourceGroup = resourceIdParts[4]; var request = new CreateWorkspaceRequest { CapacityId = pbiCapacity.CapacityId, Name = Workspace.Name }; var group = await _workspaceService.CreateAsync(request); Group = group; return(Page()); }
public async Task <IActionResult> OnGetAsync(string id) { if (string.IsNullOrEmpty(id)) { return(NotFound()); } var workspaceRequest = new WorkspaceGroup { Id = new Guid(id) }; Workspace = await _workspaceService.GetAsync(workspaceRequest); return(Page()); }
public static IEnumerable <Node> GetViaGroups(User user, WorkspaceGroup groupInfo) { var principals = user.GetGroups(); return(groupInfo.Group.Members.Where(m => principals.Contains(m.Id)).OrderBy(m => m.DisplayName)); }
public static IEnumerable<Node> GetViaGroups(User user, WorkspaceGroup groupInfo) { var principals = user.GetPrincipals(); return groupInfo.Group.Members.Where(m => principals.Contains(m.Id)).OrderBy(m => m.DisplayName); }