Domain rules for kicking and banning users from whiteboards

This commit is contained in:
Veljko Tosic
2026-02-11 21:58:08 +01:00
parent 802d8d26be
commit 3e95033fe7
8 changed files with 111 additions and 1 deletions

View File

@@ -14,5 +14,28 @@ public class WhiteboardErrors : AbstractErrors<Whiteboard, WhiteboardId>
return CreateValidationError(code, message);
}
public static ValidationError OnlyOwnerCanBanOtherUsers(UserId currentUserId)
{
string code = "only_owner_can_ban_other_users";
string message = $"Only owner of whiteboard can ban other users. Current user id: '{currentUserId}' is not the owner.";
return CreateValidationError(code, message);
}
public static ValidationError OnlyOwnerCanUnbanOtherUsers(UserId currentUserId)
{
string code = "only_owner_can_unban_other_users";
string message = $"Only owner of whiteboard can unban other users. Current user id: '{currentUserId}' is not the owner.";
return CreateValidationError(code, message);
}
public static ValidationError OnlyOwnerCanKickOtherUsers(UserId currentUserId)
{
string code = "only_owner_can_unban_other_users";
string message = $"Only owner of whiteboard can kick other users. Current user id: '{currentUserId}' is not the owner.";
return CreateValidationError(code, message);
}
}