diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-03-08 19:52:37 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-04-26 12:14:37 +0200 |
commit | 0771dad57fc9683b9abf694fb57a1cb91ca67aa2 (patch) | |
tree | 4e97e6956578b8d37e59c9b69cdacf06bb8a163a /core | |
parent | b7e8ab97e731b77ef2ec519bfb98019516b7f682 (diff) | |
download | nextcloud-server-0771dad57fc9683b9abf694fb57a1cb91ca67aa2.tar.gz nextcloud-server-0771dad57fc9683b9abf694fb57a1cb91ca67aa2.zip |
Do not add sharePermission logic in JS
We have a dedicated dav property. We should do all the magic in 1 place.
Not several.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'core')
-rw-r--r-- | core/js/files/client.js | 14 | ||||
-rw-r--r-- | core/js/files/fileinfo.js | 7 |
2 files changed, 19 insertions, 2 deletions
diff --git a/core/js/files/client.js b/core/js/files/client.js index 0109ab9fdbf..e16facbde07 100644 --- a/core/js/files/client.js +++ b/core/js/files/client.js @@ -49,7 +49,8 @@ xmlNamespaces: { 'DAV:': 'd', 'http://owncloud.org/ns': 'oc', - 'http://nextcloud.org/ns': 'nc' + 'http://nextcloud.org/ns': 'nc', + 'http://open-collaboration-services.org/ns': 'ocs' } }; if (options.userName) { @@ -65,6 +66,7 @@ Client.NS_OWNCLOUD = 'http://owncloud.org/ns'; Client.NS_NEXTCLOUD = 'http://nextcloud.org/ns'; Client.NS_DAV = 'DAV:'; + Client.NS_OCS = 'http://open-collaboration-services.org/ns'; Client.PROPERTY_GETLASTMODIFIED = '{' + Client.NS_DAV + '}getlastmodified'; Client.PROPERTY_GETETAG = '{' + Client.NS_DAV + '}getetag'; @@ -75,6 +77,7 @@ Client.PROPERTY_SIZE = '{' + Client.NS_OWNCLOUD + '}size'; Client.PROPERTY_GETCONTENTLENGTH = '{' + Client.NS_DAV + '}getcontentlength'; Client.PROPERTY_ISENCRYPTED = '{' + Client.NS_DAV + '}is-encrypted'; + Client.PROPERTY_SHARE_PERMISSIONS = '{' + Client.NS_OCS + '}share-permissions'; Client.PROTOCOL_HTTP = 'http'; Client.PROTOCOL_HTTPS = 'https'; @@ -125,6 +128,10 @@ * Encryption state */ [Client.NS_NEXTCLOUD, 'is-encrypted'], + /** + * Share permissions + */ + [Client.NS_OCS, 'share-permissions'] ]; /** @@ -373,6 +380,11 @@ } } + var sharePermissionsProp = props[Client.PROPERTY_SHARE_PERMISSIONS]; + if (!_.isUndefined(sharePermissionsProp)) { + data.sharePermissions = parseInt(sharePermissionsProp); + } + var mounTypeProp = props['{' + Client.NS_NEXTCLOUD + '}mount-type']; if (!_.isUndefined(mounTypeProp)) { data.mountType = mounTypeProp; diff --git a/core/js/files/fileinfo.js b/core/js/files/fileinfo.js index 1fc239da47a..b4ac016f90c 100644 --- a/core/js/files/fileinfo.js +++ b/core/js/files/fileinfo.js @@ -132,7 +132,12 @@ /** * @type boolean */ - hasPreview: true + hasPreview: true, + + /** + * @type int + */ + sharePermissions: null }; if (!OC.Files) { |