Skip to content

Commit bf95748

Browse files
fracadobackportbot[bot]
authored andcommitted
IONOS: fix: for shares allow document creation only for users that can edit
Signed-off-by: Franziska Bath <franziska.bath@strato.de> [skip ci]
1 parent 5b5cab2 commit bf95748

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/public.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ document.addEventListener('DOMContentLoaded', () => {
1414
return
1515
}
1616

17-
if (OCA.Files && OCA.Files.fileActions) {
17+
const userGroups = getCurrentUser()?.groups || []
18+
const editGroups = getCapabilities().config.edit_groups || []
19+
const editGroupsArray = Array.isArray(editGroups) ? editGroups : [editGroups]
20+
const userInEditGroups = editGroupsArray.some(group => userGroups.includes(group))
21+
22+
if (OCA.Files && OCA.Files.fileActions && userInEditGroups) {
1823
OC.Plugins.register('OCA.Files.NewFileMenu', NewFileMenu)
1924
}
2025

0 commit comments

Comments
 (0)