Wittyshare  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WsFsTreeClient.h
Go to the documentation of this file.
1 
14 #ifndef WS_FS_TREE_CLIENT_H__
15 #define WS_FS_TREE_CLIENT_H__
16 
19 #include <Tree/WsAccessTree.h>
20 #include <Auth/WsAuthenticator.h>
22 #include <Search/WsSearch.h>
23 #include "WsAbstractFsClient.h"
24 
25 
32 public:
37  WsFsTreeClient(const std::string& id, const std::string& pass, const std::string& ip);
38 
42  virtual ~WsFsTreeClient();
43 
47  int load();
48 
52  int getPermissions(const std::string& p);
53 
57  const WsNodeProperties* getProperties(const std::string& p);
58 
62  std::string getProperty(const std::string& section, const std::string& p, const std::string& prop);
63 
67  const std::string& getSurname() const;
68 
72  const std::string& getFirstName() const;
73 
77  const std::string& getEmail() const;
78 
82  int getLock(const std::string& path);
83 
87  int putLock(const std::string& path);
88 
92  int isLocked(const std::string& path, std::string& uid);
93 
97  NodePtr getAccessRoot( const bool& forceUpdate = false);
98 
102  vector<WsResultItem> getSearchResults(const std::string& terms);
103 
107  std::set<string> getAllGroups();
108 
112  const std::string getRootPath();
113 
117  int saveProperties(WsNodeProperties* props, const std::string& path);
118 
122  int createNode(const string& path, int type);
123 
127  int deleteNode(const string& path);
128 
132  int renameNode(const string& path, const string& newPath);
133 
137  int saveProperty(const std::string& path, const std::string& section, const std::string& attr, const std::string& val);
138 
142  bool isEditor();
143 
147  bool isAdministrator();
148 
152  std::vector<std::string> getTemplatesList(const std::string& path);
153 
154 private:
158  int authentify();
159 
163  std::set<string> m_groups;
167  std::string m_uid;
171  std::string m_pass;
175  std::string m_ip;
176  std::string m_sn;
177  std::string m_givenName;
178  std::string m_email;
183 };
184 
185 #endif
WsFsTreeOperations * m_operation
Global properties.
Reprensents the menu tree of a group. If a group does not have access to a Node, this Node will not s...
const std::string getRootPath()
return the root path of the filesystem tree, example : /var/www/demo_site
int authentify()
authenticate the user and load it's params
boost::shared_ptr< WsAbstractNode > NodePtr
std::string m_ip
WsGlobalProperties * m_conf
int load()
loads the user info
Global properties class.
std::string m_pass
std::string m_givenName
int saveProperty(const std::string &path, const std::string &section, const std::string &attr, const std::string &val)
sets one property of the node and save it on disk.
Redirect operations to adequate class.
std::string getProperty(const std::string &section, const std::string &p, const std::string &prop)
returns the properties of a node
std::set< string > m_groups
Properties of a WsNode.
std::set< string > getAllGroups()
virtual ~WsFsTreeClient()
desctrutor
WsFsTreeClient(const std::string &id, const std::string &pass, const std::string &ip)
constructor
const std::string & getFirstName() const
return the name of the person
int deleteNode(const string &path)
delete a node. The user must be an Admin on editor to remove the node In case of a WsDirNode...
const WsNodeProperties * getProperties(const std::string &p)
std::string m_uid
vector< WsResultItem > getSearchResults(const std::string &terms)
search for all matching results of terms using WsSearch class
std::string m_email
const std::string & getEmail() const
return the email of the person
int isLocked(const std::string &path, std::string &uid)
int getPermissions(const std::string &p)
Load infos of the user.
int getLock(const std::string &path)
NodePtr m_accessTree
int saveProperties(WsNodeProperties *props, const std::string &path)
save the properties of the node on disk. The user must have access and edit rights for the node...
int putLock(const std::string &path)
std::vector< std::string > getTemplatesList(const std::string &path)
int renameNode(const string &path, const string &newPath)
renames a node In case of a WsDirNode, all the contents of the directory and the directory will be mo...
Abstract Interface between the WsUser class and the operation on the tree.
int createNode(const string &path, int type)
create a directory or File. If the node is a WsDirNode than it will be only accessible to the Admin a...
NodePtr getAccessRoot(const bool &forceUpdate=false)
return the root node of the access tree starting from the root
Interface between WsUser class and local tree.
Updates the tree and takes care of unconsistencies with the user.
std::string m_sn
const std::string & getSurname() const
return the surname of the person