Encapsulates modification operations on tree.
More...
#include <WsFsTreeModification.h>
|
| WsFsTreeModification (WsFsTreeUpdater *updater) |
| Constructor. More...
|
|
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. More...
|
|
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. More...
|
|
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 and the editor who created the node More...
|
|
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 More...
|
|
int | renameNode (const std::set< std::string > &groups, const std::string &uid, const string &path, const string &newPath) |
| renames a node More...
|
|
bool | isAdministrator (const std::set< std::string > &groups) |
|
bool | isEditor (const std::set< std::string > &groups) |
|
|
bool | canEdit (NodePtr node, std::set< std::string > groups) |
| return true if the user can edit false otherwise More...
|
|
Encapsulates modification operations on tree.
Definition at line 25 of file WsFsTreeModification.h.
bool WsFsTreeModification::canEdit |
( |
NodePtr |
node, |
|
|
std::set< std::string > |
groups |
|
) |
| |
|
private |
return true if the user can edit false otherwise
- Returns
- true if the user can edit false otherwise
- Parameters
-
node | The node to test edit |
groups | the user's groups |
Definition at line 279 of file WsFsTreeModification.cpp.
int WsFsTreeModification::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 and the editor who created the node
- Parameters
-
groups | the groups of the user to test access to parent dir |
uid | uid of user |
path | path to the new node |
type | type of node 0 for file 1 for directory |
- Returns
- SUCCESS or FAILURE if no access, node already existing or failure
Definition at line 66 of file WsFsTreeModification.cpp.
int WsFsTreeModification::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
- Parameters
-
groups | the groups of the user |
uid | the uid of the user |
path | the path to the node |
- Returns
- SUCCESS or FAILURE if no access, invalid path
Definition at line 142 of file WsFsTreeModification.cpp.
bool WsFsTreeModification::isAdministrator |
( |
const std::set< std::string > & |
groups | ) |
|
- Returns
- true if the actual user is an Administrator
- Parameters
-
groups | the groups of the user |
Definition at line 274 of file WsFsTreeModification.cpp.
bool WsFsTreeModification::isEditor |
( |
const std::set< std::string > & |
groups | ) |
|
- Returns
- true if actual user is an editor
- Parameters
-
groups | the groups of the user |
Definition at line 269 of file WsFsTreeModification.cpp.
int WsFsTreeModification::renameNode |
( |
const std::set< std::string > & |
groups, |
|
|
const std::string & |
uid, |
|
|
const string & |
path, |
|
|
const string & |
newPath |
|
) |
| |
renames a node
- Parameters
-
groups | the groups of the user |
uid | the uid of the user |
path | the path to the node |
newPath | the new path |
- Returns
- SUCCESS or FAILURE if no access, invalid path, invalid new path
Definition at line 191 of file WsFsTreeModification.cpp.
int WsFsTreeModification::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.
- Parameters
-
groups | the groups of the user to test access |
json | a string containing the Json file contents |
path | the path to the node |
- Returns
- SUCCESS or FAILURE if no access, non exitent path, invalid Json
Definition at line 28 of file WsFsTreeModification.cpp.
int WsFsTreeModification::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.
- Parameters
-
groups | the groups of the user to test access |
path | the path to the node |
section | the section of the property in the Json file |
attr | the key of the property |
val | the value to set |
- Returns
- SUCCESS or FAILURE if no access, path not found
Definition at line 47 of file WsFsTreeModification.cpp.
The documentation for this class was generated from the following files: