diff --git a/apps/files_sharing/lib/Listener/LoadSidebarListener.php b/apps/files_sharing/lib/Listener/LoadSidebarListener.php index b88c3ccf0d8ba..489f15705d24d 100644 --- a/apps/files_sharing/lib/Listener/LoadSidebarListener.php +++ b/apps/files_sharing/lib/Listener/LoadSidebarListener.php @@ -51,6 +51,7 @@ public function handle(Event $event): void { $shareConfig = [ 'allowPublicUploads' => $this->shareManager->shareApiLinkAllowPublicUpload(), + 'defaultPermissions' => $this->shareManager->shareApiDefaultPermissions() ]; $this->initialState->provideInitialState('shareConfig', $shareConfig); diff --git a/apps/files_sharing/src/services/ConfigService.js b/apps/files_sharing/src/services/ConfigService.js index d1d99e7be7a5c..8afa41e80e5c3 100644 --- a/apps/files_sharing/src/services/ConfigService.js +++ b/apps/files_sharing/src/services/ConfigService.js @@ -31,6 +31,17 @@ export default class Config { this._shareConfig = loadState('files_sharing', 'shareConfig', {}) } + /** + * Get default share permissions, if any + * + * @return {boolean} + * @readonly + * @memberof Config + */ + get defaultPermissions() { + return this._shareConfig.defaultPermissions + } + /** * Is public upload allowed on link shares ? * diff --git a/lib/public/Share/IManager.php b/lib/public/Share/IManager.php index 9ac224ed7ef30..dcf8788098dd3 100644 --- a/lib/public/Share/IManager.php +++ b/lib/public/Share/IManager.php @@ -310,6 +310,14 @@ public function newShare(); */ public function shareApiEnabled(); + /** + * Get default share permissions set by admin + * + * @return int + * @since 9.0.0 + */ + public function shareApidefaultPermissions(): int; + /** * Is public link sharing enabled *