Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public static class Users
public const string Create = "Permissions.Users.Create";
public const string Update = "Permissions.Users.Update";
public const string Delete = "Permissions.Users.Delete";
public const string ManageRoles = "Permissions.Users.ManageRoles";
}

public static class Roles
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using FSH.Modules.Identity.Contracts.v1.Users.AssignUserRoles;
using FSH.Framework.Shared.Identity;
using FSH.Framework.Shared.Identity.Authorization;
using FSH.Modules.Identity.Contracts.v1.Users.AssignUserRoles;
using Mediator;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
Expand Down Expand Up @@ -27,6 +29,7 @@ internal static RouteHandlerBuilder MapAssignUserRolesEndpoint(this IEndpointRou
})
.WithName("AssignUserRoles")
.WithSummary("Assign roles to user")
.WithDescription("Assign one or more roles to a user.");
.WithDescription("Assign one or more roles to a user.")
.RequirePermission(IdentityPermissionConstants.Users.ManageRoles);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ internal static RouteHandlerBuilder MapChangePasswordEndpoint(this IEndpointRout
})
.WithName("ChangePassword")
.WithSummary("Change password")
.WithDescription("Change the current user's password.");
.WithDescription("Change the current user's password.")
.RequireAuthorization();
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System.Security.Claims;
using FSH.Framework.Core.Exceptions;
using FSH.Framework.Shared.Identity;
using FSH.Framework.Shared.Identity.Authorization;
using FSH.Framework.Shared.Identity.Claims;
using FSH.Modules.Identity.Contracts.v1.Users.GetUserPermissions;
using Mediator;
Expand All @@ -24,6 +26,7 @@ internal static RouteHandlerBuilder MapGetCurrentUserPermissionsEndpoint(this IE
})
.WithName("GetCurrentUserPermissions")
.WithSummary("Get current user permissions")
.WithDescription("Retrieve permissions for the authenticated user.");
.WithDescription("Retrieve permissions for the authenticated user.")
.RequirePermission(IdentityPermissionConstants.Users.View);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ internal static RouteHandlerBuilder MapGetMeEndpoint(this IEndpointRouteBuilder
})
.WithName("GetCurrentUserProfile")
.WithSummary("Get current user profile")
.WithDescription("Retrieve the authenticated user's profile from the access token.");
.WithDescription("Retrieve the authenticated user's profile from the access token.")
.RequireAuthorization();
}
}
Loading