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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user