Implement access control enhancements in ChatRoom and related classes

- Introduced a new overloaded method `accessAllowed` in `ChatRoom` to include user age verification for adult rooms.
- Added `falukant_user_id` method in `ChatUser` to retrieve user ID for age checks.
- Implemented `getUserAge` method in `ChatUser` to fetch and decrypt user birthdate from the database for age validation.
- Updated `roomAllowed` methods in `Server` and `SSLServer` to utilize the new access control logic, ensuring proper user context is considered.
- Enhanced debugging output for better traceability during access checks.
This commit is contained in:
Torsten Schulz (local)
2025-12-18 14:10:50 +01:00
parent 0c18a97ed7
commit 016de9e5cf
10 changed files with 213 additions and 5 deletions

View File

@@ -60,6 +60,7 @@ namespace Yc
void sendToAllUsers(ChatUser::MsgType type, Json::Value message);
unsigned int addDice(std::shared_ptr<ChatUser> user, int diceValue);
bool accessAllowed(std::string userName, std::string password);
bool accessAllowed(std::string userName, std::string password, std::shared_ptr<ChatUser> user);
bool userIsInRoom(std::string userName);
std::shared_ptr<ChatUser> findUserByName(std::string userName);
std::shared_ptr<ChatUser> findUserByToken(std::string token);