Skip to content

Commit

Permalink
pass fullShareOwnerPaths property to aggregateResourceShares
Browse files Browse the repository at this point in the history
  • Loading branch information
JammingBen committed Sep 27, 2023
1 parent 4487ea2 commit 55f0060
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export class FolderLoaderSharedViaLink implements FolderLoader {
spaces,
incomingShares: false,
allowSharePermission: unref(hasResharing),
hasShareJail: unref(hasShareJail)
hasShareJail: unref(hasShareJail),
fullShareOwnerPaths: configurationManager.options.routing.fullShareOwnerPaths
}).map((resource) => {
// info: in oc10 we have no storageId in resources. All resources are mounted into the personal space.
if (!resource.storageId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export class FolderLoaderSharedWithMe implements FolderLoader {
spaces: store.getters['runtime/spaces/spaces'],
incomingShares: true,
allowSharePermission: unref(hasResharing),
hasShareJail: unref(hasShareJail)
hasShareJail: unref(hasShareJail),
fullShareOwnerPaths: configurationManager.options.routing.fullShareOwnerPaths
}).map((resource) => {
// info: in oc10 we have no storageId in resources. All resources are mounted into the personal space.
if (!resource.storageId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ export class FolderLoaderSharedWithOthers implements FolderLoader {
spaces: store.getters['runtime/spaces/spaces'],
incomingShares: false,
allowSharePermission: unref(hasResharing),
hasShareJail: unref(hasShareJail)
hasShareJail: unref(hasShareJail),
fullShareOwnerPaths: configurationManager.options.routing.fullShareOwnerPaths
}).map((resource) => {
// info: in oc10 we have no storageId in resources. All resources are mounted into the personal space.
if (!resource.storageId) {
Expand Down
5 changes: 3 additions & 2 deletions packages/web-app-files/src/services/folder/loaderSpace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class FolderLoaderSpace implements FolderLoader {
}

public getTask(context: TaskContext): FolderLoaderTask {
const { store, router, clientService } = context
const { store, router, clientService, configurationManager } = context
const { owncloudSdk: client, webdav } = clientService
const { replaceInvalidFileRoute } = useFileRouteReplace({ router })
const hasResharing = useCapabilityFilesSharingResharing(store)
Expand Down Expand Up @@ -61,7 +61,8 @@ export class FolderLoaderSpace implements FolderLoader {
spaces: store.getters['runtime/spaces/spaces'],
allowSharePermission: unref(hasResharing),
hasShareJail: true,
incomingShares: true
incomingShares: true,
fullShareOwnerPaths: configurationManager.options.routing.fullShareOwnerPaths
})
currentFolder = aggregatedShares[0]
} else if (!['personal', 'public'].includes(space.driveType)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
useCapabilityFilesSharingResharing,
useCapabilityShareJailEnabled,
useClientService,
useConfigurationManager,
useLoadingService,
useRouter,
useStore
Expand All @@ -25,6 +26,7 @@ export const useFileActionsAcceptShare = ({ store }: { store?: Store<any> } = {}
const hasShareJail = useCapabilityShareJailEnabled()
const clientService = useClientService()
const loadingService = useLoadingService()
const configurationManager = useConfigurationManager()

const handler = async ({ resources }: FileActionOptions) => {
const errors = []
Expand All @@ -40,7 +42,8 @@ export const useFileActionsAcceptShare = ({ store }: { store?: Store<any> } = {}
hasResharing: unref(hasResharing),
hasShareJail: unref(hasShareJail),
client: clientService.owncloudSdk,
spaces: store.getters['runtime/spaces/spaces']
spaces: store.getters['runtime/spaces/spaces'],
fullShareOwnerPaths: configurationManager.options.routing.fullShareOwnerPaths
})
if (share) {
store.commit('Files/UPDATE_RESOURCE', share)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
useCapabilityFilesSharingResharing,
useCapabilityShareJailEnabled,
useClientService,
useConfigurationManager,
useLoadingService,
useRouter,
useStore
Expand All @@ -28,6 +29,7 @@ export const useFileActionsDeclineShare = ({ store }: { store?: Store<any> } = {
const hasShareJail = useCapabilityShareJailEnabled()
const clientService = useClientService()
const loadingService = useLoadingService()
const configurationManager = useConfigurationManager()

const handler = async ({ resources }: FileActionOptions) => {
const errors = []
Expand All @@ -43,7 +45,8 @@ export const useFileActionsDeclineShare = ({ store }: { store?: Store<any> } = {
hasResharing: unref(hasResharing),
hasShareJail: unref(hasShareJail),
client: clientService.owncloudSdk,
spaces: store.getters['runtime/spaces/spaces']
spaces: store.getters['runtime/spaces/spaces'],
fullShareOwnerPaths: configurationManager.options.routing.fullShareOwnerPaths
})
if (share) {
store.commit('Files/UPDATE_RESOURCE', share)
Expand Down
7 changes: 5 additions & 2 deletions packages/web-pkg/src/helpers/share/triggerShareAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ export async function triggerShareAction({
hasResharing,
hasShareJail,
client,
spaces = []
spaces = [],
fullShareOwnerPaths = false
}: {
resource: Resource
status: ShareStatus
hasResharing: boolean
hasShareJail: boolean
client: OwnCloudSdk
spaces?: SpaceResource[]
fullShareOwnerPaths?: boolean
}) {
const method = _getRequestMethod(status)
if (!method) {
Expand Down Expand Up @@ -45,7 +47,8 @@ export async function triggerShareAction({
spaces,
incomingShares: true,
allowSharePermission: hasResharing,
hasShareJail
hasShareJail,
fullShareOwnerPaths
})[0]
}
}
Expand Down

0 comments on commit 55f0060

Please sign in to comment.