Encapsulates consultation of tree (no modification)
More...
#include <WsFsTreeConsultation.h>
|
| | WsFsTreeConsultation (WsFsTreeUpdater *updater) |
| | Constructor. More...
|
| |
| int | getPermissions (const std::set< std::string > &groups, const std::string &p) |
| | Get the permissions for a path for a set of groups. More...
|
| |
| WsNodeProperties * | getProperties (const std::set< std::string > &groups, const std::string &p) |
| | get properties of a node corresponding to the path More...
|
| |
| 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 More...
|
| |
| 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 because is detented by someone else. ErrorCode::Failure if an error occured A positive value with the duration in seconds of the lock is returned otherwise. More...
|
| |
| 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 unlock the path. More...
|
| |
| 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 More...
|
| |
| WsAccessTree * | getAccessTree (const std::set< std::string > &groups) |
| | Get the access tree starting from rootPath. More...
|
| |
| std::vector< WsResultItem > | getSearchResults (const std::set< std::string > &groups, const std::string &terms) |
| | Get the results for searching for "terms". More...
|
| |
| const std::string | getRootPath () |
| |
| std::vector< std::string > | getTemplatesList (const std::set< std::string > &groups, const std::string &path) |
| | TODO. More...
|
| |
| const std::string & | getFsTreeStamp () |
| | Get the stamp of the last WsFileSystemTree. More...
|
| |
Encapsulates consultation of tree (no modification)
Definition at line 27 of file WsFsTreeConsultation.h.
| WsAccessTree * WsFsTreeConsultation::getAccessTree |
( |
const std::set< std::string > & |
groups | ) |
|
Get the access tree starting from rootPath.
- Parameters
-
| groups | the groups of the user to test access |
| rootPath | the starting path of the access tree, default is "/" and will return the access tree starting from the root |
- Returns
- a WsMenuTree containing the nodes of the access tree. if an error occured or no access, the root of the WsAccessTree will be NULL
Definition at line 275 of file WsFsTreeConsultation.cpp.
| const string & WsFsTreeConsultation::getFsTreeStamp |
( |
| ) |
|
| int WsFsTreeConsultation::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 because is detented by someone else. ErrorCode::Failure if an error occured A positive value with the duration in seconds of the lock is returned otherwise.
- Parameters
-
| groups | the groups of the user |
| uid | the uid of the user |
| path | the path to the node |
Definition at line 89 of file WsFsTreeConsultation.cpp.
| int WsFsTreeConsultation::getPermissions |
( |
const std::set< std::string > & |
groups, |
|
|
const std::string & |
p |
|
) |
| |
Get the permissions for a path for a set of groups.
- Parameters
-
| groups | the set of gids to test |
| p | the path to the node (relative path) |
- Returns
- READ READ_WRITE NO_ACCESS
Definition at line 27 of file WsFsTreeConsultation.cpp.
| WsNodeProperties * WsFsTreeConsultation::getProperties |
( |
const std::set< std::string > & |
groups, |
|
|
const std::string & |
p |
|
) |
| |
get properties of a node corresponding to the path
- Parameters
-
| groups | the groups to see if access is granted to the node |
| p | the path to the node (relative path) |
- Returns
- a WsNodeProperties correcponding to the properties of the node or a NULL object if access is not granted or path not found
Definition at line 63 of file WsFsTreeConsultation.cpp.
| std::string WsFsTreeConsultation::getProperty |
( |
const std::set< std::string > & |
groups, |
|
|
const std::string & |
section, |
|
|
const std::string & |
p, |
|
|
const std::string & |
prop |
|
) |
| |
get a property for a node corresponding to the path
- Parameters
-
| groups | the groups to see if access is granted to the path |
| section | the section of the property in the Json tree |
| prop | the key of the property to retrieve |
| p | the path to the node (relative path) |
- Returns
- a string containing the property of a empty string if access is denied or path non existent
Definition at line 81 of file WsFsTreeConsultation.cpp.
| const std::string WsFsTreeConsultation::getRootPath |
( |
| ) |
|
| std::vector< WsResultItem > WsFsTreeConsultation::getSearchResults |
( |
const std::set< std::string > & |
groups, |
|
|
const std::string & |
terms |
|
) |
| |
Get the results for searching for "terms".
- Parameters
-
| groups | groups of the user to test access |
| terms | the terms of the search |
- Returns
- a vector of WsResultItem. Each WsResultItem is a node with a small description. If no results, an empty vector is returned
Definition at line 296 of file WsFsTreeConsultation.cpp.
| std::vector< std::string > WsFsTreeConsultation::getTemplatesList |
( |
const std::set< std::string > & |
groups, |
|
|
const std::string & |
path |
|
) |
| |
| long WsFsTreeConsultation::getTimeMs |
( |
| ) |
|
|
private |
| int WsFsTreeConsultation::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
- Returns
- 1 if the path is unlocked
-
ErrorCode::Locked if the file is locked and the uid of the user who locked it will be stored in uid return ErrorCode::Failure if an error occured
- Parameters
-
| groups | the groups of the user |
| uid | the uid of the user |
| path | the path to the node |
| id | an empty string |
Definition at line 209 of file WsFsTreeConsultation.cpp.
| int WsFsTreeConsultation::putLock |
( |
const std::set< std::string > |
groups, |
|
|
const std::string & |
uid, |
|
|
const std::string & |
path |
|
) |
| |
| boost::mutex WsFsTreeConsultation::m_lockEditMutex |
|
private |
The documentation for this class was generated from the following files: