diff options
Diffstat (limited to 'apps/files_sharing/src/models/Share.js')
-rw-r--r-- | apps/files_sharing/src/models/Share.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/apps/files_sharing/src/models/Share.js b/apps/files_sharing/src/models/Share.js index e9d84fb5556..13b68ad68be 100644 --- a/apps/files_sharing/src/models/Share.js +++ b/apps/files_sharing/src/models/Share.js @@ -420,6 +420,31 @@ export default class Share { return !!((this.permissions & OC.PERMISSION_SHARE)) } + // PERMISSIONS Shortcuts for the CURRENT USER + // ! the permissions above are the share settings, + // ! meaning the permissions for the recipient + /** + * Can the current user EDIT this share ? + * + * @returns {boolean} + * @readonly + * @memberof Share + */ + get canEdit() { + return this.#share.can_edit === true + } + + /** + * Can the current user DELETE this share ? + * + * @returns {boolean} + * @readonly + * @memberof Share + */ + get canDelete() { + return this.#share.can_delete === true + } + // TODO: SORT THOSE PROPERTIES get label() { return this.#share.label |