public async Task <IActionResult> GetCollectionsForFile(string fileKey) { try { var userKey = _contextAccessor.UserKeyFromContext(); bool userCanAccessFile = await UserCanAccessFile(userKey, fileKey, _hiarcDatabase, AccessLevelGroup.ReadOnlyOrHigher); if (userCanAccessFile) { var theFile = await _hiarcDatabase.GetCollectionsForFile(fileKey); return(Ok(theFile)); } else { return(StatusCode(StatusCodes.Status403Forbidden)); } } catch (Exception ex) { return(BuildErrorResponse(ex, _logger)); } }