Merge pull request #60521 from nextcloud/backport/60187/stable32

[stable32] fix(files): only show template picker menu entries if possible
This commit is contained in:
Stephan Orbaugh 2026-05-20 12:25:16 +02:00 committed by GitHub
commit b9c22da3c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 4 deletions

View file

@ -62,7 +62,13 @@ export function registerTemplateEntries() {
iconClass: provider.iconClass || 'icon-file',
iconSvgInline: provider.iconSvgInline,
enabled(context: Folder): boolean {
return (context.permissions & Permission.CREATE) !== 0
if (context.attributes['is-encrypted']) {
return false
}
// templates are only supported in folders where the user has read and create permissions
return (context.permissions & Permission.READ) !== 0
&& (context.permissions & Permission.CREATE) !== 0
},
order: 11,
async handler(context: Folder, content: Node[]) {

4
dist/files-init.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long