diff --git a/src/components/SelectionManager.vue b/src/components/SelectionManager.vue index 73263f1b..72d1ae9a 100644 --- a/src/components/SelectionManager.vue +++ b/src/components/SelectionManager.vue @@ -40,6 +40,7 @@ import { generateUrl } from '@nextcloud/router' import { NcActions, NcActionButton } from '@nextcloud/vue'; import { translate as t, translatePlural as n } from '@nextcloud/l10n' import { IHeadRow, IPhoto, ISelectionAction } from '../types'; +import { getCurrentUser } from '@nextcloud/auth'; import * as dav from "../services/DavRequests"; import EditDate from "./modal/EditDate.vue" @@ -355,6 +356,12 @@ export default class SelectionHandler extends Mixins(GlobalMixin, UserConfig) { return; } + // Check photo ownership + if (this.$route.params.user !== getCurrentUser().uid) { + showError(this.t('memories', 'Only user "{user}" can update this person', { user })); + return; + } + // Run query for await (let delIds of dav.removeFaceImages(user, name, Array.from(selection.keys()))) { const delPhotos = delIds.filter(x => x).map(id => selection.get(id)); diff --git a/src/components/modal/FaceDeleteModal.vue b/src/components/modal/FaceDeleteModal.vue index 05f4613a..0321dc90 100644 --- a/src/components/modal/FaceDeleteModal.vue +++ b/src/components/modal/FaceDeleteModal.vue @@ -1,5 +1,5 @@