-
-
{{ $t('layout.portlet.allowUsingInSpaceContext') }}
+
+
{{ $t('portlets.selectWhoCanAddIt') }}
+
+
+
+
+
+
+ {{ $t('portlets.administratorsMandatorySelectionTooltip') }}
+
+
+
p.includes('/platform/users'));
+ this.aclContributors = this.aclSpaceHost || !!instance.permissions?.find?.(p => p.includes('/platform/web-contributors'));
} else {
this.categoryId = this.$root?.selectedCategoryId;
+ this.aclSpaceHost = true;
+ this.aclContributors = true;
}
this.contentId = instance?.contentId || contentId;
- this.spaceApplication = instance?.spaceApplication || false;
this.title = instance?.name || null;
this.titleTranslations = {};
this.descriptionTranslations = {};
@@ -193,7 +229,7 @@ export default {
this.$portletInstanceService.getPortletInstance(this.instanceId)
.then(instance => {
instance.categoryId = this.categoryId;
- instance.spaceApplication = this.spaceApplication;
+ instance.permissions = this.getPermissions();
return this.$portletInstanceService.updatePortletInstance(instance)
.then(() => {
this.$root.$emit('portlet-instance-updated', instance);
@@ -204,7 +240,7 @@ export default {
: this.$portletInstanceService.createPortletInstance({
categoryId: this.categoryId,
contentId: this.contentId,
- spaceApplication: this.spaceApplication,
+ permissions: this.getPermissions(),
})
.then(instance => {
this.$root.$emit('portlet-instance-created', instance);
@@ -228,6 +264,13 @@ export default {
})
.finally(() => this.saving = false);
},
+ getPermissions() {
+ const permissions = [this.aclSpaceHost && '*:/platform/users' || '*:/platform/administrators'];
+ if (this.aclContributors) {
+ permissions.push('*:/platform/web-contributors');
+ }
+ return permissions;
+ },
checkCKEdtiorDisplay() {
if (this.$refs.portletInstanceDescriptionEditor?.editor
&& this.description !== this.$refs.portletInstanceDescriptionEditor.inputVal) {