Salome HOME
ProfilesService
[modules/gde.git] / projects / GDE_API_CPP / api / src / UserService.hpp
1 #ifndef GDE_USER_SERVICE_HPP
2 #define GDE_USER_SERVICE_HPP
3
4 #include "User.hpp"
5 #include "UserGroup.hpp"
6 #include "GDESession.hpp"
7
8 #include <string>
9
10 namespace gde {
11
12   class UserService {
13     friend class GDESession;
14
15   public:
16     const User createUser(const std::string& name, const std::string& password);
17     bool deleteUser(const User&);
18     const User findUser(const std::string& name);
19
20     const UserGroup createUserGroup(const std::string& name);
21     bool deleteUserGroup(const UserGroup&);
22     const UserGroup findUserGroup(const std::string& name);
23
24     bool addToUserGroup(const UserGroup&, const User&);
25     bool removeFromUserGroup(const UserGroup&, const User&);
26
27   private:
28     UserService(const GDESession& session) : _session(session) {}
29     ~UserService() {}
30     UserService(const UserService&); // non copyable
31     UserService& operator=(const UserService&); // non copyable
32
33   private:
34     static std::string _servletName;
35     const GDESession& _session;
36
37   };
38
39 };
40
41 #endif