#include <UserManager.hpp>
Inherits pion::platform::ConfigManager, and pion::net::PionUserManager.
Definition at line 41 of file UserManager.hpp.
Public Member Functions | |
| UserManager () | |
| construct a new UserManager Instance | |
| virtual | ~UserManager () |
| virtual destructor | |
| virtual void | openConfigFile (void) |
| opens an existing User config file and loads the data it contains | |
| virtual void | writeConfigXML (std::ostream &out) const |
| bool | writeConfigXML (std::ostream &out, const std::string &user_id) const |
| bool | writePermissionsXML (std::ostream &out, const std::string &user_id) const |
| std::string | addUser (const std::string &user_id, xmlNodePtr config_ptr) |
| void | setUserConfig (const std::string &user_id, xmlNodePtr config_ptr) |
| virtual bool | removeUser (const std::string &user_id) |
| bool | creationAllowed (const pion::net::PionUserPtr &user_from_request, const pion::platform::ConfigManager &config_manager, const xmlNodePtr &config_ptr) const |
| bool | updateAllowed (const pion::net::PionUserPtr &user_from_request, const pion::platform::ConfigManager &config_manager, const std::string &id, const xmlNodePtr &config_ptr) const |
| bool | removalAllowed (const pion::net::PionUserPtr &user_from_request, const pion::platform::ConfigManager &config_manager, const std::string &id) const |
| bool | accessAllowed (const pion::net::PionUserPtr &user_from_request, const pion::platform::ConfigManager &config_manager, const std::string &plugin_id) const |
| bool | accessAllowed (const pion::net::PionUserPtr &user_from_request, const PlatformService &service, const std::string &id="") const |
Static Public Member Functions | |
| static xmlNodePtr | createUserConfig (std::string &user_id, const char *buf, std::size_t len) |
Classes | |
| class | AddUserConfigException |
| exception thrown if there is an error adding a User to the config file More... | |
| class | DuplicateUserException |
| exception thrown if a request is made to add a User when a User with the same ID has already been added More... | |
| class | EmptyUserIdException |
| exception thrown if a user_id parameter is found to be empty More... | |
| class | MissingOpenSSLException |
| exception thrown if Pion is built without support for OpenSSL More... | |
| class | MissingUserIdInConfigFileException |
| exception thrown if the config file contains a User with an empty or missing identifier More... | |
| class | NoPasswordException |
| exception thrown if a request is made to add or update a User with a configuration with an empty or missing password More... | |
| class | UpdateUserConfigException |
| exception thrown if there is an error updating a User in the config file More... | |
| class | UserNotFoundException |
| exception thrown if a User cannot be found More... | |
| class | UserUpdateFailedException |
| exception thrown if a User update failed More... | |
| bool pion::server::UserManager::accessAllowed | ( | const pion::net::PionUserPtr & | user_from_request, | |
| const PlatformService & | service, | |||
| const std::string & | id = "" | |||
| ) | const |
determines whether a User has permission to use a PlatformService
| user_from_request | pointer to an existing User element node, as extracted from a request | |
| service | the PlatformService | |
| id | optional unique identifier specifying a subset of the PlatformService |
Definition at line 493 of file UserManager.cpp.
References pion::server::PlatformService::accessAllowed(), and pion::server::PlatformService::getPermissionType().
| bool pion::server::UserManager::accessAllowed | ( | const pion::net::PionUserPtr & | user_from_request, | |
| const pion::platform::ConfigManager & | config_manager, | |||
| const std::string & | plugin_id | |||
| ) | const |
determines whether a User has permission to use a plugin
| user_from_request | pointer to an existing User element node, as extracted from a request | |
| config_manager | the plugin manager corresponding to the plugin | |
| plugin_id | unique identifier associated with an existing plugin |
Definition at line 473 of file UserManager.cpp.
References pion::platform::ConfigManager::accessAllowed(), and pion::platform::ConfigManager::getPermissionType().
| std::string pion::server::UserManager::addUser | ( | const std::string & | user_id, | |
| xmlNodePtr | config_ptr | |||
| ) |
adds a new managed User
| user_id | unique identifier associated with the User | |
| config_ptr | pointer to a list of XML nodes containing User configuration parameters |
Definition at line 203 of file UserManager.cpp.
References pion::platform::ConfigManager::getConfigFile(), pion::platform::ConfigManager::ID_ATTRIBUTE_NAME, pion::platform::ConfigManager::m_config_node_ptr, pion::platform::ConfigManager::saveConfigFile(), and setUserConfig().
| xmlNodePtr pion::server::UserManager::createUserConfig | ( | std::string & | user_id, | |
| const char * | buf, | |||
| std::size_t | len | |||
| ) | [static] |
uses a memory buffer to generate XML configuration data for a User
| user_id | will get the unique identifier associated with the User | |
| buf | pointer to a memory buffer containing configuration data | |
| len | number of bytes available in the memory buffer |
Definition at line 370 of file UserManager.cpp.
References pion::platform::ConfigManager::findConfigNodeByName(), pion::platform::ConfigManager::getNodeId(), and pion::platform::ConfigManager::ROOT_ELEMENT_NAME.
| bool pion::server::UserManager::creationAllowed | ( | const pion::net::PionUserPtr & | user_from_request, | |
| const pion::platform::ConfigManager & | config_manager, | |||
| const xmlNodePtr & | config_ptr | |||
| ) | const |
determines whether a User has permission to create a new configuration node
| user_from_request | pointer to an existing User element node, as extracted from a request | |
| config_manager | the plugin manager corresponding to the type of the configuration | |
| config_ptr | pointer to the new configuration; if null, returns true only if the User has permission for any configuration handled by the config manager |
Definition at line 412 of file UserManager.cpp.
References pion::platform::ConfigManager::creationAllowed(), and pion::platform::ConfigManager::getPermissionType().
| bool pion::server::UserManager::removalAllowed | ( | const pion::net::PionUserPtr & | user_from_request, | |
| const pion::platform::ConfigManager & | config_manager, | |||
| const std::string & | id | |||
| ) | const |
determines whether a User has permission to remove a configuration node or set of configuration nodes
| user_from_request | pointer to an existing User element node, as extracted from a request | |
| config_manager | the plugin manager corresponding to the type of the configuration | |
| id | unique identifier associated with an existing configuration node or set of configuration nodes |
Definition at line 453 of file UserManager.cpp.
References pion::platform::ConfigManager::getPermissionType(), and pion::platform::ConfigManager::removalAllowed().
| bool pion::server::UserManager::removeUser | ( | const std::string & | user_id | ) | [virtual] |
removes a managed User
| user_id | unique identifier associated with the User (username) |
Reimplemented from pion::net::PionUserManager.
Definition at line 311 of file UserManager.cpp.
References pion::platform::ConfigManager::removePluginConfig(), and pion::platform::ConfigManager::saveConfigFile().
| void pion::server::UserManager::setUserConfig | ( | const std::string & | user_id, | |
| xmlNodePtr | config_ptr | |||
| ) |
sets (updates) configuration parameters for a managed User
| user_id | unique identifier associated with the User | |
| config_ptr | pointer to a list of XML nodes containing User configuration parameters |
Definition at line 280 of file UserManager.cpp.
References pion::platform::ConfigManager::findConfigNodeByAttr(), pion::platform::ConfigManager::getConfigFile(), pion::platform::ConfigManager::ID_ATTRIBUTE_NAME, pion::platform::ConfigManager::m_config_node_ptr, and pion::platform::ConfigManager::saveConfigFile().
Referenced by addUser().
| bool pion::server::UserManager::updateAllowed | ( | const pion::net::PionUserPtr & | user_from_request, | |
| const pion::platform::ConfigManager & | config_manager, | |||
| const std::string & | id, | |||
| const xmlNodePtr & | config_ptr | |||
| ) | const |
determines whether a User has permission to update a configuration node
| user_from_request | pointer to an existing User element node, as extracted from a request | |
| config_manager | the plugin manager corresponding to the type of the configuration | |
| id | unique identifier associated with an existing configuration node | |
| config_ptr | pointer to the new configuration; if null, returns true only if the User has permission for any configuration handled by the config manager |
Definition at line 432 of file UserManager.cpp.
References pion::platform::ConfigManager::getPermissionType(), and pion::platform::ConfigManager::updateAllowed().
| bool pion::server::UserManager::writeConfigXML | ( | std::ostream & | out, | |
| const std::string & | user_id | |||
| ) | const |
writes the configuration data for a particular User (as XML)
| out | the ostream to write the configuration tree into | |
| user_id | unique identifier associated with the User |
Definition at line 182 of file UserManager.cpp.
References pion::platform::ConfigManager::findConfigNodeByAttr(), pion::platform::ConfigManager::ID_ATTRIBUTE_NAME, and pion::platform::ConfigManager::m_config_node_ptr.
| void pion::server::UserManager::writeConfigXML | ( | std::ostream & | out | ) | const [virtual] |
writes the entire configuration tree to an output stream (as XML)
| out | the ostream to write the configuration tree into |
Reimplemented from pion::platform::ConfigManager.
Definition at line 176 of file UserManager.cpp.
References pion::platform::ConfigManager::m_config_node_ptr.
| bool pion::server::UserManager::writePermissionsXML | ( | std::ostream & | out, | |
| const std::string & | user_id | |||
| ) | const |
writes the Permission configuration data for a particular User (as XML)
| out | the ostream to write the configuration tree into | |
| user_id | unique identifier associated with the User |
Definition at line 249 of file UserManager.cpp.
References pion::platform::ConfigManager::findConfigNodeByAttr(), pion::platform::ConfigManager::ID_ATTRIBUTE_NAME, and pion::platform::ConfigManager::m_config_node_ptr.
1.4.7