summaryrefslogtreecommitdiffstats
path: root/core/js/shareitemmodel.js
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-04-07 17:14:05 -0500
committerGitHub <noreply@github.com>2017-04-07 17:14:05 -0500
commitca9d25169dcdd2923a356e2a797d8704506a3787 (patch)
tree5d94aed1a5f79a5b0abe33d8732fc60e0a4054b3 /core/js/shareitemmodel.js
parent9adfa60eb38f6c39ae075e1fa68037375c8789de (diff)
parentbf30090be5e3d339c9188d81a900ed2fe4bd6318 (diff)
downloadnextcloud-server-ca9d25169dcdd2923a356e2a797d8704506a3787.tar.gz
nextcloud-server-ca9d25169dcdd2923a356e2a797d8704506a3787.zip
Merge pull request #4136 from nextcloud/expire-date-for-all-shares
Unified sharing options
Diffstat (limited to 'core/js/shareitemmodel.js')
-rw-r--r--core/js/shareitemmodel.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js
index ae4c07e3f4e..6bb8d75b91f 100644
--- a/core/js/shareitemmodel.js
+++ b/core/js/shareitemmodel.js
@@ -363,6 +363,10 @@
return this.get('reshare').share_type;
},
+ getExpireDate: function(shareIndex) {
+ return this._shareExpireDate(shareIndex);
+ },
+
/**
* Returns all share entries that only apply to the current item
* (file/folder)
@@ -449,6 +453,16 @@
return (share.permissions & permission) === permission;
},
+
+ _shareExpireDate: function(shareIndex) {
+ var share = this.get('shares')[shareIndex];
+ if(!_.isObject(share)) {
+ throw "Unknown Share";
+ }
+ var date2 = share.expiration;
+ return date2;
+ },
+
/**
* @returns {boolean}
*/
@@ -509,6 +523,10 @@
return this._shareHasPermission(shareIndex, OC.PERMISSION_DELETE);
},
+ hasReadPermission: function(shareIndex) {
+ return this._shareHasPermission(shareIndex, OC.PERMISSION_READ);
+ },
+
/**
* @returns {boolean}
*/
@@ -757,7 +775,7 @@
isLinkShare: true,
id: share.id,
token: share.token,
- password: share.share_with,
+ password: share.password,
link: link,
permissions: share.permissions,
// currently expiration is only effective for link shares.