Parse share owner from Webdav to display in UI
This commit is contained in:
parent
dc8ce87a26
commit
21da6271a8
|
@ -50,7 +50,7 @@
|
||||||
if (fileData.shareOwner) {
|
if (fileData.shareOwner) {
|
||||||
tr.attr('data-share-owner', fileData.shareOwner);
|
tr.attr('data-share-owner', fileData.shareOwner);
|
||||||
// user should always be able to rename a mount point
|
// user should always be able to rename a mount point
|
||||||
if (fileData.isShareMountPoint) {
|
if (fileData.mountType === 'shared-root') {
|
||||||
tr.attr('data-permissions', fileData.permissions | OC.PERMISSION_UPDATE);
|
tr.attr('data-permissions', fileData.permissions | OC.PERMISSION_UPDATE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,6 +68,26 @@
|
||||||
return fileInfo;
|
return fileInfo;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var NS_OC = 'http://owncloud.org/ns';
|
||||||
|
|
||||||
|
var oldGetWebdavProperties = fileList._getWebdavProperties;
|
||||||
|
fileList._getWebdavProperties = function() {
|
||||||
|
var props = oldGetWebdavProperties.apply(this, arguments);
|
||||||
|
props.push('{' + NS_OC + '}owner-display-name');
|
||||||
|
return props;
|
||||||
|
};
|
||||||
|
|
||||||
|
fileList.filesClient.addFileInfoParser(function(response) {
|
||||||
|
var data = {};
|
||||||
|
var props = response.propStat[0].properties;
|
||||||
|
var permissionsProp = props['{' + NS_OC + '}permissions'];
|
||||||
|
|
||||||
|
if (permissionsProp && permissionsProp.indexOf('S') >= 0) {
|
||||||
|
data.shareOwner = props['{' + NS_OC + '}owner-display-name'];
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
});
|
||||||
|
|
||||||
// use delegate to catch the case with multiple file lists
|
// use delegate to catch the case with multiple file lists
|
||||||
fileList.$el.on('fileActionsReady', function(ev){
|
fileList.$el.on('fileActionsReady', function(ev){
|
||||||
var fileList = ev.fileList;
|
var fileList = ev.fileList;
|
||||||
|
|
Loading…
Reference in New Issue