Skip to content

Commit

Permalink
feat: Allow Space Manager to edit pages - MEED-6941 - Meeds-io/meeds#…
Browse files Browse the repository at this point in the history
…2064 (#96)

Prior to this change, a space host wasn't able to access the navigation
setting of a space. This change will allow to do it and will hide the
option to save a page template knowing that it's not accessible only for
administrators.
  • Loading branch information
boubaker authored and rdenarie committed Jun 7, 2024
1 parent 2ee1686 commit d4cbe2f
Showing 6 changed files with 10 additions and 55 deletions.
Original file line number Diff line number Diff line change
@@ -25,6 +25,5 @@
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_2.xsd">

<import>war:/conf/layout/dynamic-container-configuration.xml</import>
<import>war:/conf/layout/features-configuration.xml</import>

</configuration>
Original file line number Diff line number Diff line change
@@ -46,10 +46,7 @@
<field name="permissions">
<collection type="java.util.ArrayList">
<value>
<string>manager:/platform/administrators</string>
</value>
<value>
<string>editor:/platform/web-contributors</string>
<string>*:/platform/users</string>
</value>
</collection>
</field>

This file was deleted.

8 changes: 4 additions & 4 deletions layout-webapp/src/main/webapp/WEB-INF/jsp/layoutEditor.jsp
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<%@page import="org.exoplatform.commons.api.settings.ExoFeatureService"%>
<%@page import="io.meeds.layout.service.LayoutAclService"%>
<%@page import="org.exoplatform.container.ExoContainerContext"%>
<%
ExoFeatureService featureService = ExoContainerContext.getService(ExoFeatureService.class);
boolean layoutAllAppsDrawerActive = featureService.isFeatureActiveForUser("LayoutAllAppsDrawer", request.getRemoteUser());
LayoutAclService aclService = ExoContainerContext.getService(LayoutAclService.class);
boolean isAdministrator = aclService.isAdministrator(request.getRemoteUser());
%>
<div class="VuetifyApp">
<div id="layoutEditor">
<script type="text/javascript">
require(['PORTLET/layout/LayoutEditor'], app => app.init());
eXo.env.portal.layoutAllAppsDrawer = <%=layoutAllAppsDrawerActive%>;
eXo.env.portal.isAdministrator = <%=isAdministrator%>;
</script>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -19,6 +19,7 @@
<script type="text/javascript">
eXo.env.portal.siteKeyName = '<%=siteName%>';
eXo.env.portal.isAdministrator = <%=isAdministrator%>;
eXo.env.portal.canManageSiteNavigation = <%=canManageSiteNavigation%>;
require(['PORTLET/layout/SiteNavigation'], app => app.init(<%=canManageSiteNavigation%>));
</script>
</div>
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@
<v-spacer />
<layout-editor-toolbar-history-buttons class="me-3" />
<layout-editor-toolbar-save-as-template-button
v-if="!pageTemplateId"
v-if="!pageTemplateId && isAdministrator"
class="me-3" />
<layout-editor-toolbar-preview-button
class="me-3" />
@@ -64,6 +64,9 @@ export default {
},
},
computed: {
isAdministrator() {
return eXo.env.portal.isAdministrator;
},
defaultLanguage() {
return eXo.env.portal.defaultLanguage;
},

0 comments on commit d4cbe2f

Please sign in to comment.