diff options
Diffstat (limited to 'src/Common/UserManager.cpp')
-rw-r--r-- | src/Common/UserManager.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/Common/UserManager.cpp b/src/Common/UserManager.cpp index 0ccf314..c53a2af 100644 --- a/src/Common/UserManager.cpp +++ b/src/Common/UserManager.cpp @@ -241,5 +241,56 @@ void UserManager::addUser(const UserInfo &userInfo) throw(Core::Exception) { throw Core::Exception(Core::Exception::NOT_IMPLEMENTED); } +void UserManager::updateUser(unsigned long uid, const UserInfo &userInfo) throw(Core::Exception) { + boost::lock_guard<boost::shared_mutex> lock(mutex); + + for(BackendMap::iterator backend = backends.begin(); backend != backends.end(); ++backend) { + try { + backend->second->updateUser(uid, userInfo); + return; + } + catch(Core::Exception e) { + if(e.getErrorCode() != Core::Exception::NOT_IMPLEMENTED) + throw e; + } + } + + throw Core::Exception(Core::Exception::NOT_IMPLEMENTED); +} + +void UserManager::addGroup(const GroupInfo &groupInfo) throw(Core::Exception) { + boost::lock_guard<boost::shared_mutex> lock(mutex); + + for(BackendMap::iterator backend = backends.begin(); backend != backends.end(); ++backend) { + try { + backend->second->addGroup(groupInfo); + return; + } + catch(Core::Exception e) { + if(e.getErrorCode() != Core::Exception::NOT_IMPLEMENTED) + throw e; + } + } + + throw Core::Exception(Core::Exception::NOT_IMPLEMENTED); +} + +void UserManager::updateGroup(unsigned long gid, const GroupInfo &groupInfo) throw(Core::Exception) { + boost::lock_guard<boost::shared_mutex> lock(mutex); + + for(BackendMap::iterator backend = backends.begin(); backend != backends.end(); ++backend) { + try { + backend->second->updateGroup(gid, groupInfo); + return; + } + catch(Core::Exception e) { + if(e.getErrorCode() != Core::Exception::NOT_IMPLEMENTED) + throw e; + } + } + + throw Core::Exception(Core::Exception::NOT_IMPLEMENTED); +} + } } |