From 9e5e120ef9869b7c52d90e85782ec83a9217275d Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Mon, 10 Oct 2016 10:15:42 +0200 Subject: refactor share permission logic into own method to reuse it for the share tab Signed-off-by: Christoph Wurst --- apps/files_sharing/js/sharetabview.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'apps/files_sharing/js/sharetabview.js') diff --git a/apps/files_sharing/js/sharetabview.js b/apps/files_sharing/js/sharetabview.js index 2c7070aa3d5..7bb1f1229d0 100644 --- a/apps/files_sharing/js/sharetabview.js +++ b/apps/files_sharing/js/sharetabview.js @@ -50,6 +50,10 @@ if (this.model) { this.$el.html(this.template()); + if (_.isUndefined(this.model.get('sharePermissions'))) { + this.model.set('sharePermissions', OCA.Sharing.Util.getSharePermissions(this.model.attributes)); + } + // TODO: the model should read these directly off the passed fileInfoModel var attributes = { itemType: this.model.isDirectory() ? 'folder' : 'file', -- cgit v1.2.3