Skip to content

Commit 6d8ff98

Browse files
committed
Improved the code gen and access checks for project controller.
1 parent 547855d commit 6d8ff98

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Exceptionless.Web/Controllers/ProjectController.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public async Task<ActionResult<ClientConfiguration>> GetConfigAsync(string? id =
247247
if (project is null)
248248
return NotFound();
249249

250-
if (_isOwnedByOrganization && !CanAccessOrganization(project.OrganizationId))
250+
if (!CanAccessOrganization(project.OrganizationId))
251251
return NotFound();
252252

253253
if (v.HasValue && v == project.Configuration.Version)
@@ -314,6 +314,7 @@ public async Task<IActionResult> DeleteConfigAsync(string id, string key)
314314
/// Reset project data
315315
/// </summary>
316316
/// <param name="id">The identifier of the project.</param>
317+
/// <response code="202">Accepted</response>
317318
/// <response code="404">The project could not be found.</response>
318319
[HttpGet("{id:objectid}/reset-data")]
319320
[Authorize(Policy = AuthorizationRoles.UserPolicy)]
@@ -428,7 +429,7 @@ public async Task<IActionResult> SetNotificationSettingsAsync(string id, string
428429
[HttpPost("{id:objectid}/{integration:minlength(1)}/notifications")]
429430
[Consumes("application/json")]
430431
[Authorize(Policy = AuthorizationRoles.UserPolicy)]
431-
public async Task<IActionResult> SetIntegrationNotificationSettingsAsync(string id, string integration, NotificationSettings settings)
432+
public async Task<IActionResult> SetIntegrationNotificationSettingsAsync(string id, string integration, NotificationSettings? settings)
432433
{
433434
if (!String.Equals(Project.NotificationIntegrations.Slack, integration))
434435
return NotFound();
@@ -442,7 +443,7 @@ public async Task<IActionResult> SetIntegrationNotificationSettingsAsync(string
442443
return NotFound();
443444

444445
if (!organization.HasPremiumFeatures)
445-
return PlanLimitReached($"Please upgrade your plan to enable {integration.TrimStart('@')} integration.");
446+
return PlanLimitReached($"Please upgrade your plan to enable {integration} integration.");
446447

447448
if (settings is null)
448449
project.NotificationSettings.Remove(integration);

0 commit comments

Comments
 (0)