Skip to content

Commit c1db32e

Browse files
committed
add edit permission to sharing
Signed-off-by: Christian Hartmann <[email protected]>
1 parent a1d8072 commit c1db32e

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

src/components/SidebarTabs/SharingShareDiv.vue

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,19 @@
1717
<NcActions class="share-div__actions">
1818
<NcActionCaption :name="t('forms', 'Permissions')" />
1919
<NcActionCheckbox
20-
:checked="canAccessResults"
21-
@update:checked="updatePermissionResults">
20+
:model-value="canEditForm"
21+
@update:model-value="updatePermissionEdit">
22+
{{ t('forms', 'Edit form') }}
23+
</NcActionCheckbox>
24+
<NcActionCheckbox
25+
:model-value="canAccessResults"
26+
@update:model-value="updatePermissionResults">
2227
{{ t('forms', 'View responses') }}
2328
</NcActionCheckbox>
2429
<NcActionCheckbox
25-
:checked="canDeleteResults"
30+
:model-value="canDeleteResults"
2631
:disabled="!canAccessResults"
27-
@update:checked="updatePermissionDeleteResults">
32+
@update:model-value="updatePermissionDeleteResults">
2833
{{ t('forms', 'Delete responses') }}
2934
</NcActionCheckbox>
3035
<NcActionSeparator />
@@ -81,6 +86,11 @@ export default {
8186
this.PERMISSION_TYPES.PERMISSION_RESULTS_DELETE,
8287
)
8388
},
89+
canEditForm() {
90+
return this.share.permissions.includes(
91+
this.PERMISSION_TYPES.PERMISSION_EDIT,
92+
)
93+
},
8494
isNoUser() {
8595
return this.share.shareType !== this.SHARE_TYPES.SHARE_TYPE_USER
8696
},
@@ -133,6 +143,16 @@ export default {
133143
)
134144
},
135145
146+
/**
147+
* @param {boolean} hasPermission If the results_delete permission should be granted
148+
*/
149+
updatePermissionEdit(hasPermission) {
150+
return this.updatePermission(
151+
this.PERMISSION_TYPES.PERMISSION_EDIT,
152+
hasPermission,
153+
)
154+
},
155+
136156
/**
137157
* Grant or remove permission from share
138158
*

0 commit comments

Comments
 (0)