diff options
Diffstat (limited to 'lib/private/connector/sabre/node.php')
-rw-r--r-- | lib/private/connector/sabre/node.php | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/lib/private/connector/sabre/node.php b/lib/private/connector/sabre/node.php index eede39cba8b..f124b754443 100644 --- a/lib/private/connector/sabre/node.php +++ b/lib/private/connector/sabre/node.php @@ -56,7 +56,7 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr protected $info; /** - * @brief Sets up the node, expects a full path name + * Sets up the node, expects a full path name * @param \OC\Files\View $view * @param \OCP\Files\FileInfo $info */ @@ -71,7 +71,7 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr } /** - * @brief Returns the name of the node + * Returns the name of the node * @return string */ public function getName() { @@ -79,7 +79,7 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr } /** - * @brief Renames the node + * Renames the node * @param string $name The new name * @throws Sabre_DAV_Exception_BadRequest * @throws Sabre_DAV_Exception_Forbidden @@ -116,7 +116,7 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr } /** - * @brief Returns the last modification time, as a unix timestamp + * Returns the last modification time, as a unix timestamp * @return int timestamp as integer */ public function getLastModified() { @@ -138,7 +138,7 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr } /** - * @brief Updates properties on this node, + * Updates properties on this node, * @see Sabre_DAV_IProperties::updateProperties * @param array $properties * @return boolean @@ -188,7 +188,7 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr } /** - * @brief Returns a list of properties for this nodes.; + * Returns a list of properties for this nodes.; * @param array $properties * @return array * @note The properties list is a list of propertynames the client @@ -237,4 +237,36 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr return null; } + + /** + * @return string|null + */ + public function getDavPermissions() { + $p =''; + if ($this->info->isShared()) { + $p .= 'S'; + } + if ($this->info->isShareable()) { + $p .= 'R'; + } + if ($this->info->isMounted()) { + $p .= 'M'; + } + if ($this->info->isDeletable()) { + $p .= 'D'; + } + if ($this->info->isDeletable()) { + $p .= 'N'; + } + if ($this->info->getType() === \OCP\Files\FileInfo::TYPE_FILE) { + if ($this->info->isUpdateable()) { + $p .= 'W'; + } + } else { + if ($this->info->isUpdateable()) { + $p .= 'CK'; + } + } + return $p; + } } |