feature/permissions-middleware #147
No reviewers
Labels
No labels
bug
enhancement
feature
groupe/chat-data
groupe/friends-blocking
groupe/input-validation
groupe/realtime-presence
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Transcendence/backend!147
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/permissions-middleware"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -5,3 +6,3 @@namespace KeepGrouped.API.Roles;public sealed class CreateRoleQuery(KeepGroupedDb db): IHandlerpublic sealed class CreateRoleQuery(KeepGroupedDb db) : IHandlerCommand pas Query
@ -19,0 +23,4 @@return RoleProblems.RankingTooLow();}if (db_role.Name == "Member")Transformer member en static const dans Role
et pour le suepr role aussi
@ -21,0 +36,4 @@{rl.Ranking--;await db.SaveChangesAsync();}Changer en list_change.foreach ET SURTOUT ne pas appeler savechanges a chaque item, appeler une seule fois a la fin
@ -18,2 +18,3 @@}role.Permission = perm;if (tk.User.Role.Ranking >= db_role.Ranking || ((int)tk.User.Role.Permission & Math.Abs(perm)) == 0)faire des operations binaires
@ -0,0 +16,4 @@return RoleProblems.OpNotFound(direction);}var op = direction == "up" ? -1 : +1;Un role qui ne devrait pas le pouvoir peut se up a l'infini
@ -8,3 +10,3 @@public static void MapLogoutUser(this IEndpointRouteBuilder auth){auth.MapDelete("/logout/{id}", [Authorize] async (LogoutQuery query, HttpContext http, string id) =>auth.MapDelete("/logout/{id}", [Authorize][Roles(Perms.HandleUsers)] async (LogoutQuery query, HttpContext http, string id) =>check le ranking des roles
41a27c837e3778f38fba