diff --git a/changelog/unreleased/enhancement-public-link-permission b/changelog/unreleased/enhancement-public-link-permission
new file mode 100644
index 00000000000..1bcb7d2ce37
--- /dev/null
+++ b/changelog/unreleased/enhancement-public-link-permission
@@ -0,0 +1,6 @@
+Enhancement: Public link permission `PublicLink.Write.all`
+
+Support for the public link permission `PublicLink.Write.all` has been added. Users without this permission won't be able to create public links (except for oC10 instances where this permission is being set implicitly).
+
+https://github.com/owncloud/web/pull/8541
+https://github.com/owncloud/web/issues/8540
diff --git a/packages/web-app-files/src/components/FilesList/QuickActions.vue b/packages/web-app-files/src/components/FilesList/QuickActions.vue
index 98e03f50c0c..8a9f0f7647f 100644
--- a/packages/web-app-files/src/components/FilesList/QuickActions.vue
+++ b/packages/web-app-files/src/components/FilesList/QuickActions.vue
@@ -8,7 +8,9 @@
appearance="raw"
class="oc-mr-xs quick-action-button oc-p-xs"
:class="`files-quick-action-${action.id}`"
- @click="action.handler({ ...$language, item, client: $client, store: $store })"
+ @click="
+ action.handler({ ...$language, item, client: $client, store: $store, ability: $ability })
+ "
>
diff --git a/packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue b/packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue
index 5e402839f09..4a5ae951d6d 100644
--- a/packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue
+++ b/packages/web-app-files/src/components/SideBar/Shares/FileLinks.vue
@@ -5,7 +5,7 @@
@@ -31,7 +31,7 @@
/>
can('create-all', 'PublicLink'))
return {
...useGraphClient(),
@@ -176,7 +179,8 @@ export default defineComponent({
linkListCollapsed,
outgoingLinks,
directLinks,
- indirectLinks
+ indirectLinks,
+ canCreatePublicLinks
}
},
computed: {
@@ -255,7 +259,7 @@ export default defineComponent({
return shareViaIndirectLinkHelp
},
- canCreatePublicLinks() {
+ canCreateLinks() {
if (this.resource.isReceivedShare() && !this.hasResharing) {
return false
}
@@ -269,7 +273,7 @@ export default defineComponent({
},
canEdit() {
- return this.canCreatePublicLinks
+ return this.canCreateLinks
},
noResharePermsMessage() {
@@ -363,7 +367,7 @@ export default defineComponent({
this.checkLinkToCreate({
link: {
name: this.$gettext('Link'),
- permissions: 1,
+ permissions: this.canCreatePublicLinks ? 1 : 0,
expiration: this.expirationDate.default,
password: false
}
@@ -452,7 +456,6 @@ export default defineComponent({
await this.addLink({
path,
client: this.$client,
- $gettext: this.$gettext,
storageId: this.resource.fileId || this.resource.id,
params
}).catch((e) => {
@@ -541,14 +544,15 @@ export default defineComponent({
},
getAvailableRoleOptions(link) {
- if (this.incomingParentShare && this.canCreatePublicLinks) {
+ if (this.incomingParentShare && this.canCreateLinks) {
return LinkShareRoles.filterByBitmask(
this.incomingParentShare.permissions,
this.resource.isFolder,
this.hasPublicLinkEditing,
this.hasPublicLinkContribute,
this.hasPublicLinkAliasSupport,
- !!link.password
+ !!link.password,
+ this.canCreatePublicLinks
)
}
@@ -557,7 +561,8 @@ export default defineComponent({
this.hasPublicLinkEditing,
this.hasPublicLinkContribute,
this.hasPublicLinkAliasSupport,
- !!link.password
+ !!link.password,
+ this.canCreatePublicLinks
)
}
}
diff --git a/packages/web-app-files/src/components/SideBar/Shares/Links/CreateQuickLink.vue b/packages/web-app-files/src/components/SideBar/Shares/Links/CreateQuickLink.vue
index 22f3805c1ef..d04b21be2dd 100644
--- a/packages/web-app-files/src/components/SideBar/Shares/Links/CreateQuickLink.vue
+++ b/packages/web-app-files/src/components/SideBar/Shares/Links/CreateQuickLink.vue
@@ -18,7 +18,8 @@