Domain rules for kicking and banning users from whiteboards
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user