20 using namespace boost;
21 using namespace boost::filesystem;
32 LOG(
DEBUG) <
"WsFsTreeClient :: destructor called";
159 return m_groups.count(
m_conf->
get(
"global",
"admin_group",
"administrator")) > 0;
WsFsTreeOperations * m_operation
const std::string getRootPath()
return the root path of the filesystem tree, example : /var/www/demo_site
int putLock(const std::set< std::string > groups, const std::string &uid, const std::string &path)
unlocks the file by deleting the .config/locks/filename.lock file Only the owner of the lock can unlo...
int authentify()
authenticate the user and load it's params
boost::shared_ptr< WsAbstractNode > NodePtr
std::string getProperty(const std::set< std::string > &groups, const std::string §ion, const std::string &p, const std::string &prop)
get a property for a node corresponding to the path
WsGlobalProperties * m_conf
int load()
loads the user info
std::string getUid()
return the user uid WsAuthenticator::authentify must be called before
std::string getSurname()
return the user surname WsAuthenticator::authentify must be called before
int saveProperty(const std::set< std::string > &groups, const std::string &path, const std::string §ion, const std::string &attr, const std::string &val)
save a property of the node. The user must have access and edit rights for the node.
int saveProperties(const std::set< std::string > &groups, const std::string &json, const std::string &path)
save the properties of the node. The user must have access and edit rights for the node...
std::string getEmail()
return the user email WsAuthenticator::authentify must be called before
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.
Redirect operations to adequate class.
Loads Authentification module and acts as an interface.
std::string getProperty(const std::string §ion, const std::string &p, const std::string &prop)
returns the properties of a node
std::set< string > m_groups
WsAccessTree * getAccessTree(const std::set< std::string > &groups)
Get the access tree starting from rootPath.
std::set< string > getAllGroups()
virtual ~WsFsTreeClient()
desctrutor
WsFsTreeClient(const std::string &id, const std::string &pass, const std::string &ip)
constructor
std::vector< WsResultItem > getSearchResults(const std::set< std::string > &groups, const std::string &terms)
Get the results for searching for "terms".
const std::string & getFirstName() const
return the name of the person
Interacts directly with the menuTree and the fsTree.
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...
int renameNode(const std::set< std::string > &groups, const std::string &uid, const string &path, const string &newPath)
renames a node
const WsNodeProperties * getProperties(const std::string &p)
int getLock(const std::set< std::string > groups, const std::string &uid, const std::string &path)
tries to acquire the lock for the path. @ return ErrorCode::Locked if the lock cannot be aquired beca...
WsNodeProperties * getProperties(const std::set< std::string > &groups, const std::string &p)
get properties of a node corresponding to the path
vector< WsResultItem > getSearchResults(const std::string &terms)
search for all matching results of terms using WsSearch class
Json::Value getRoot()
Return the root of the Json tree.
int getPermissions(const std::set< std::string > &groups, const std::string &p)
Get the permissions for a path for a set of groups.
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)
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...
virtual NodePtr getRoot()
Returns the root node of the menuTree.
int putLock(const std::string &path)
int deleteNode(const std::set< std::string > &groups, const std::string &uid, const string &path)
delete a node. The user must be an Admin on editor to remove the node
std::vector< std::string > getTemplatesList(const std::string &path)
int isLocked(const std::set< std::string > groups, const std::string &uid, const std::string &path, std::string &id)
check is the path is already locked
std::set< std::string > getUserGroups()
return the user groups WsAuthenticator::authentify must be called before
std::set< std::string > getAllGroups()
return all the possible groups WsAuthenticator::authentify must be called before
std::string get(const std::string §ion, const std::string &id, const std::string &def)
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 getRootPath()
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...
static WsGlobalProperties * instance()
NodePtr getAccessRoot(const bool &forceUpdate=false)
return the root node of the access tree starting from the root
int authentify(const std::string &uid, const std::string &pass="", const std::string &ip="")
authentify the user.
const std::string & getSurname() const
return the surname of the person
std::string getFirstName()
return the user name WsAuthenticator::authentify must be called before
int createNode(const std::set< std::string > &groups, const std::string &uid, 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...
int update()
Update the WsFileSystemTree.