44 WsUser(
const std::string& strUid,
const std::string& pass =
"",
const std::string& ip =
"");
93 const std::string&
getUid()
const;
99 int getLock(
const std::string& path);
105 int putLock(
const std::string& path);
114 int isLocked(
const std::string& path, std::string& uid);
141 std::string
getProperty(
const std::string& path,
const std::string& section,
const string& attr,
const std::string& def);
171 int saveProperty(
const std::string& path,
const std::string& section,
const std::string& attr,
const std::string& val);
197 int renameNode(
const string& path,
const string& newPath);
208 int writeFile(
const std::string path,
const std::string& text);
228 std::string
cleanPath(
const std::string& path);
int isLocked(const std::string &path, std::string &uid)
check is the path is already locked
boost::shared_ptr< WsAbstractNode > NodePtr
std::string cleanPath(const std::string &path)
int getPermissions(const std::string &p)
return the permissions on specific node
int saveProperty(const std::string &path, const std::string §ion, const std::string &attr, const std::string &val)
sets one property of the node and save it on disk.
std::string getProperty(const std::string &path, const std::string §ion, const string &attr, const std::string &def)
returns one property of a node If the property does not exist, a empty string is returned.
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...
WsAbstractFsClient * m_client
this will be an instance of WsFsTreeClient if not using daemon or WsFsDaemonClient if using daemon ...
int putLock(const std::string &path)
releases the lock for the path.
std::vector< WsResultItem > getSearchResults(const std::string &terms)
search for all matching results of terms using WsSearch class
std::vector< std::string > getTemplatesList(const std::string &path)
return all the templates contained in a directory and parents If two templates have the same name...
int writeFile(const std::string path, const std::string &text)
writes the text to the file
WsUser(const std::string &strUid, const std::string &pass="", const std::string &ip="")
Constructor.
Interacts directly with the menuTree and the fsTree.
const std::string getHomePage()
return the home page
Interface that provides differents methods for accessing the FsTree as well as other features...
std::set< std::string > getAllGroups()
Interacts with the menuTree and FsTree via the daemon.
int load()
Load infos of the user.
const std::string & getEmail() const
return the email of the person
const std::string & getFirstName() const
return the name of the person
int m_isDaemon
Use daemon or no.
const std::string getRootPath()
return the root path of the filesystem tree, example : /var/www/demo_site
const std::string & getSurname() const
return the surname of the person
int createNode(const string &path, NodeType type)
create a directory or File. If the node is a WsDirNode than it will be only accessible to the Admin a...
Abstract Interface between the WsUser class and the operation on the tree.
const WsNodeProperties * getProperties(const std::string &p)
returns the properties of a node
NodePtr getAccessRoot()
return the root node of the access tree starting from the root
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...
const std::string & getUid() const
int getLock(const std::string &path)
tries to acquire the lock for the path. @ return ErrorCode::Locked if the lock cannot be aquired beca...
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...
WsGlobalProperties * m_conf