Skip to content

Users ( User Manager )

SpaceOC edited this page Aug 29, 2024 · 1 revision

UserManager class

#include "Core/base/users/user_manager.h"
  • userIsYou(std::string username) is a bool variable. Returns true if the specified user is you.

  • userExist(std::string username) - bool variable. Returns true if the specified user exists.

  • havePassword(std::string username) - bool variable. Returns true if the specified user has a password.

  • userHaveAdminPermissions(std::string username) - bool variable. Returns true if the specified user has admin permissions (permissionsEC::admin).

  • permissionsCheck(permissionsEC permissions) - bool variable.

  • permissionsHighCurrentUser(std::string username) - bool variable. Returns true if the specified user's permissions are higher than the current user.

  • getOOBE_Passed() - bool variable. Returns true if OOBE has been passed.

  • yourUsername() - std::string variable. Returns the name of the current user.

  • getUserMap() - std::map<std::string, std::string> variable. Returns the username and display name of all existing users.

  • getLocalVarsMap(std::string username) - std::map<std::string, std::string> variable. Returns the variable names and descriptions of a particular user.

  • getLanguageMap() - std::map<std::string, std::string> variable. Returns the names of users and their languages.

  • getPermissionsMap() - std::map<std::string, core::permissionsEC> variable. Returns user names and their permissions.

  • checkOOBE_Passed() - function. Checks whether OOBE has been passed or not.

  • system_addUser(std::string username) - function. Adds a user with administrator privileges and the name that was entered in the argument.

  • addUser(std::string username, core::permissionsEC permissions) - function. Creates a user with a specific name and permissions (which were specified in the function arguments). (Successful addition of a user requires that the current user has administrator permissions). You can create no more than 10 accounts in NRC!

  • deleteUser(std::string username) - function. Deletes a specific user (Successful deletion requires that the current user has admin rights and that the user defined in the argument has rights lower than yours and is not the current user (the one you are interacting with pseudo-OS and NRC).

  • renameUser(std::string username, std::string newUsername) - function. Renames a specific user. (Successful renaming requires that the current user has administrator privileges and the user defined in the argument has privileges lower than yours and is not the current user (the one you are interacting with pseudo-OS and NRC))

  • changePermissionsUser(std::string username, core::permissionsEC newPermissions) - function. Changes the permissions of a certain user. (Successful permissions change requires that the current user has administrator permissions and the user defined in the argument has permissions lower than yours)

  • userLists() - function. Created specifically for core.cpp and OOBE.cpp! Please do not use

  • userLogout() - function. Automatically logout from a user and start the process of logging into another one. Not recommended to use if you don't know what to do with it.

  • saveUserData(std::string username) - function. Saves the data of a certain user (username, display name, language, password, permissions) into a .json file at the path ./Data/Users/username.json

  • readUserData(std::string username) - function. Reads and modifies (if the .json file has been modified) certain values/data (username, display name, language, password, permissions) in the user.

  • readAllUsersData() - function. Reads all user data.

Clone this wiki locally