File tree Expand file tree Collapse file tree
apps/files_sharing/src/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -197,11 +197,14 @@ export default defineComponent({
197197 },
198198
199199 data() {
200+ const destination = (this .context .permissions & Permission .SHARE )
201+ ? this .context .path
202+ : ' /'
200203 return {
201204 currentStep: STEP .FIRST ,
202205 loading: false ,
203206
204- destination: this . context . path || ' / ' ,
207+ destination ,
205208 label: ' ' ,
206209 note: ' ' ,
207210
Original file line number Diff line number Diff line change 7373</template >
7474
7575<script lang="ts">
76- import type { Folder , Node } from ' @nextcloud/files'
76+ import type { Folder , INode } from ' @nextcloud/files'
7777import type { PropType } from ' vue'
7878
7979import { getFilePickerBuilder } from ' @nextcloud/dialogs'
80+ import { Permission } from ' @nextcloud/files'
8081import { t } from ' @nextcloud/l10n'
8182import { defineComponent } from ' vue'
8283import NcTextArea from ' @nextcloud/vue/components/NcTextArea'
@@ -146,6 +147,7 @@ export default defineComponent({
146147 callback: this .onPickedDestination ,
147148 })
148149 .setFilter ((node ) => node .path !== ' /' )
150+ .setCanPick ((node ) => Boolean (node .permissions & Permission .SHARE ))
149151 .startAt (this .destination )
150152 .build ()
151153 try {
@@ -155,7 +157,7 @@ export default defineComponent({
155157 }
156158 },
157159
158- onPickedDestination(nodes : Node []) {
160+ onPickedDestination(nodes : INode []) {
159161 const node = nodes [0 ]
160162 if (node ) {
161163 this .$emit (' update:destination' , node .path )
You can’t perform that action at this time.
0 commit comments