1010namespace XtremeIdiots . Portal . Web . Controllers ;
1111
1212/// <summary>
13- /// Provides map browsing, search, and image retrieval functionality
13+ /// Provides map browsing, search, and image retrieval. The public map browsing
14+ /// endpoints (<c>Index</c>, <c>GameIndex</c>, <c>MapImage</c>) are anonymous —
15+ /// they expose only public map metadata and imagery. Admin-only actions
16+ /// (e.g. <c>VoteLog</c>) carry their own explicit [Authorize] — each action
17+ /// opts in to its own auth posture rather than inheriting from the class.
1418/// </summary>
1519/// <remarks>
1620/// Initializes a new instance of the MapsController
@@ -19,7 +23,6 @@ namespace XtremeIdiots.Portal.Web.Controllers;
1923/// <param name="telemetryClient">Client for tracking telemetry data</param>
2024/// <param name="logger">Logger instance for this controller</param>
2125/// <param name="configuration">Application configuration</param>
22- [ Authorize ( Policy = AuthPolicies . MapRotations_Read ) ]
2326public class MapsController (
2427 IRepositoryApiClient repositoryApiClient ,
2528 TelemetryClient telemetryClient ,
@@ -34,6 +37,7 @@ public class MapsController(
3437 /// <param name="cancellationToken">Cancellation token for the async operation</param>
3538 /// <returns>Maps index view</returns>
3639 [ HttpGet ]
40+ [ AllowAnonymous ]
3741 public async Task < IActionResult > Index ( CancellationToken cancellationToken = default )
3842 {
3943 return await ExecuteWithErrorHandlingAsync ( ( ) => Task . FromResult < IActionResult > ( View ( ) ) , nameof ( Index ) ) . ConfigureAwait ( false ) ;
@@ -46,6 +50,7 @@ public async Task<IActionResult> Index(CancellationToken cancellationToken = def
4650 /// <param name="cancellationToken">Cancellation token for the async operation</param>
4751 /// <returns>Maps index view with game type filter applied</returns>
4852 [ HttpGet ]
53+ [ AllowAnonymous ]
4954 public async Task < IActionResult > GameIndex ( GameType ? id , CancellationToken cancellationToken = default )
5055 {
5156 return await ExecuteWithErrorHandlingAsync ( ( ) =>
@@ -63,6 +68,7 @@ public async Task<IActionResult> GameIndex(GameType? id, CancellationToken cance
6368 /// <param name="cancellationToken">Cancellation token for the async operation</param>
6469 /// <returns>Redirect to map image URI or default no-image placeholder</returns>
6570 [ HttpGet ]
71+ [ AllowAnonymous ]
6672 public async Task < IActionResult > MapImage ( GameType gameType , string mapName , CancellationToken cancellationToken = default )
6773 {
6874 return await ExecuteWithErrorHandlingAsync ( async ( ) =>
@@ -88,11 +94,12 @@ public async Task<IActionResult> MapImage(GameType gameType, string mapName, Can
8894 }
8995
9096 /// <summary>
91- /// Displays the map vote log/audit page
97+ /// Displays the map vote log/audit page (admin-only)
9298 /// </summary>
9399 /// <param name="cancellationToken">Cancellation token for the async operation</param>
94100 /// <returns>Vote log view</returns>
95101 [ HttpGet ]
102+ [ Authorize ( Policy = AuthPolicies . MapRotations_Read ) ]
96103 public async Task < IActionResult > VoteLog ( CancellationToken cancellationToken = default )
97104 {
98105 return await ExecuteWithErrorHandlingAsync ( ( ) => Task . FromResult < IActionResult > ( View ( ) ) , nameof ( VoteLog ) ) . ConfigureAwait ( false ) ;
0 commit comments