mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix(files): only show template picker menu entries if possible
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
dffb132c23
commit
fcb949c5e6
1 changed files with 7 additions and 1 deletions
|
|
@ -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[]) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue