Wittyshare  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WsFsTreeModification.h
Go to the documentation of this file.
1 /*
2  *
3  * Filename: WsFsTreeModification.h
4  *
5  * Description:
6  *
7  * Created: 03/21/2013 04:18:54 AM
8  * Revision: none
9  *
10  * Author: Benoit Daccache (BD), ben.daccache@gmail.com
11  * Company:
12  *
13  */
14 
15 #ifndef WS_FSTREE_MODIFICATION_H__
16 #define WS_FSTREE_MODIFICATION_H__
17 
18 #include <Tree/WsAccessTree.h>
19 #include <Search/WsResultItem.h>
21 
26 public:
27 
34 
38  int saveProperties( const std::set<std::string>& groups, const std::string& json, const std::string& path) ;
39 
43  int saveProperty( const std::set<std::string>& groups, const std::string& path, const std::string& section, const std::string& attr, const std::string& val) ;
44 
48  int createNode( const std::set<std::string>& groups, const std::string& uid, const string& path, int type) ;
49 
53  int deleteNode( const std::set<std::string>& groups, const std::string& uid, const string& path) ;
54 
58  int renameNode( const std::set<std::string>& groups, const std::string& uid, const string& path, const string& newPath) ;
59 
63  bool isAdministrator( const std::set<std::string>& groups);
64 
68  bool isEditor( const std::set<std::string>& groups );
69 
70 
71 private:
78  bool canEdit(NodePtr node, std::set<std::string> groups);
79 
82 
83 
84 
85 
86 };
87 
88 #endif
int renameNode(const std::set< std::string > &groups, const std::string &uid, const string &path, const string &newPath)
renames a node
WsFsTreeModification(WsFsTreeUpdater *updater)
Constructor.
Reprensents the menu tree of a group. If a group does not have access to a Node, this Node will not s...
boost::shared_ptr< WsAbstractNode > NodePtr
int saveProperty(const std::set< std::string > &groups, const std::string &path, const std::string &section, 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.
Global properties class.
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...
handles the update of the FileSystemTree
WsFsTreeUpdater * m_updater
WsGlobalProperties * m_conf
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
Encapsulates modification operations on tree.
bool isEditor(const std::set< std::string > &groups)
bool isAdministrator(const std::set< std::string > &groups)
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...
Updates the tree and takes care of unconsistencies with the user.
bool canEdit(NodePtr node, std::set< std::string > groups)
return true if the user can edit false otherwise