Skip to content

Commit

Permalink
feat: Add Permission choice when creating Portlet Instance - MEED-698…
Browse files Browse the repository at this point in the history
  • Loading branch information
boubaker committed Jun 4, 2024
1 parent 39ef525 commit f224bdd
Show file tree
Hide file tree
Showing 10 changed files with 110 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ public class PortletInstanceEntity implements Serializable {
@Column(name = "IS_SYSTEM")
private boolean system;

@Column(name = "IS_SPACE_APPLICATION")
private boolean spaceApplication;

@Column(name = "IS_DISABLED")
private boolean disabled;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,4 @@ public class PortletInstance {

private boolean disabled;

private boolean spaceApplication;

}
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ public class PortletInstanceDescriptor {

private boolean system;

private boolean spaceApplication;

private String illustrationPath;

}
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ protected PortletInstance savePortletInstance(PortletInstanceDescriptor d, long
portletInstance.setCategoryId(getCategorySettingValue(d.getCategoryNameId()));
portletInstance.setPermissions(d.getPermissions());
portletInstance.setPreferences(d.getPreferences());
portletInstance.setSpaceApplication(d.isSpaceApplication());
portletInstance.setSystem(d.isSystem());
if (isNew) {
return portletInstanceService.createPortletInstance(portletInstance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ public static PortletInstance fromEntity(PortletInstanceEntity entity, PortletDe
entity.getPermissions().stream().filter(StringUtils::isNotBlank).toList(),
portlet == null ? null : portlet.getSupportedModes(),
entity.isSystem(),
entity.isDisabled(),
entity.isSpaceApplication());
entity.isDisabled());
}

public static PortletInstanceCategoryEntity toEntity(PortletInstanceCategory instance) {
Expand All @@ -82,7 +81,6 @@ public static PortletInstanceEntity toEntity(PortletInstance instance) {
instance.getPermissions(),
getPreferencesString(instance),
instance.isSystem(),
instance.isSpaceApplication(),
instance.isDisabled(),
Objects.hash(instance.getCategoryId(),
getPreferencesString(instance),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,22 +503,6 @@
</addColumn>
</changeSet>

<changeSet
author="layout"
id="1.0.0-31">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="PORTAL_APPLICATIONS" columnName="IS_SPACE_APPLICATION"/>
</not>
</preConditions>
<addColumn tableName="PORTAL_APPLICATIONS">
<column
name="IS_SPACE_APPLICATION"
type="Boolean"
defaultValueBoolean="false" />
</addColumn>
</changeSet>

<changeSet
author="layout"
id="1.0.0-32">
Expand Down
96 changes: 47 additions & 49 deletions layout-service/src/main/resources/portlet-instances.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"permissions":[
"*:/platform/users"
],
"system":true,
"spaceApplication":true
"system":true
},
{
"nameId":"SpaceSettingPortlet",
Expand All @@ -37,8 +36,7 @@
"permissions":[
"*:/platform/users"
],
"system":true,
"spaceApplication":true
"system":true
},
{
"nameId":"Image",
Expand All @@ -57,8 +55,7 @@
"permissions":[
"Everyone"
],
"system":true,
"spaceApplication":false
"system":true
},
{
"nameId":"Links",
Expand All @@ -77,8 +74,7 @@
"permissions":[
"Everyone"
],
"system":true,
"spaceApplication":false
"system":true
},
{
"nameId":"ExternalSpacesList",
Expand All @@ -97,8 +93,7 @@
"permissions":[
"*:/platform/users"
],
"system":true,
"spaceApplication":false
"system":true
},
{
"nameId":"GettingStarted",
Expand All @@ -111,10 +106,10 @@
"en":"layout.portletInstance.GettingStarted.description"
},
"permissions":[
"*:/platform/users"
"*:/platform/administrators",
"*:/platform/web-contributors"
],
"system":true,
"spaceApplication":false
"system":true
},
{
"nameId":"SpaceBannerPortlet",
Expand All @@ -133,8 +128,7 @@
"permissions":[
"*:/platform/users"
],
"system":true,
"spaceApplication":false
"system":true
},
{
"nameId":"WhoIsOnLinePortlet",
Expand All @@ -153,8 +147,7 @@
"permissions":[
"*:/platform/users"
],
"system":true,
"spaceApplication":false
"system":true
},
{
"nameId":"PeopleOverview",
Expand All @@ -173,8 +166,7 @@
"permissions":[
"*:/platform/users"
],
"system":true,
"spaceApplication":false
"system":true
},
{
"nameId":"SpaceActivityStreamPortlet",
Expand All @@ -193,8 +185,7 @@
"permissions":[
"*:/platform/users"
],
"system":true,
"spaceApplication":true
"system":true
},
{
"nameId":"SpacesOverview",
Expand All @@ -211,10 +202,10 @@

],
"permissions":[
"*:/platform/users"
"*:/platform/administrators",
"*:/platform/web-contributors"
],
"system":true,
"spaceApplication":false
"system":true
},
{
"nameId":"SuggestionsPeopleAndSpace",
Expand All @@ -231,10 +222,10 @@

],
"permissions":[
"*:/platform/users"
"*:/platform/administrators",
"*:/platform/web-contributors"
],
"system":true,
"spaceApplication":false
"system":true
},
{
"nameId":"UserActivityStreamPortlet",
Expand All @@ -251,10 +242,10 @@

],
"permissions":[
"*:/platform/users"
"*:/platform/administrators",
"*:/platform/web-contributors"
],
"system":true,
"spaceApplication":false
"system":true
},
{
"nameId":"SpaceInfos",
Expand All @@ -273,8 +264,7 @@
"permissions":[
"*:/platform/users"
],
"system":true,
"spaceApplication":false
"system":true
},
{
"nameId":"VerticalMenu",
Expand All @@ -291,10 +281,10 @@

],
"permissions":[
"*:/platform/users"
"*:/platform/administrators",
"*:/platform/web-contributors"
],
"system":true,
"spaceApplication":false
"system":true
},
{
"nameId":"VerticalMenu",
Expand All @@ -311,10 +301,10 @@

],
"permissions":[
"*:/platform/users"
"*:/platform/administrators",
"*:/platform/web-contributors"
],
"system":true,
"spaceApplication":false
"system":true
},
{
"nameId":"Breadcrumb",
Expand All @@ -331,10 +321,10 @@

],
"permissions":[
"*:/platform/users"
"*:/platform/administrators",
"*:/platform/web-contributors"
],
"system":true,
"spaceApplication":false
"system":true
},
{
"nameId":"GeneralSettings",
Expand All @@ -347,7 +337,8 @@
"en":"layout.portletInstance.GeneralSettings.description"
},
"permissions":[
"*:/platform/users"
"*:/platform/administrators",
"*:/platform/web-contributors"
],
"system":true
},
Expand All @@ -362,7 +353,8 @@
"en":"layout.portletInstance.UserSettingLanguage.description"
},
"permissions":[
"*:/platform/users"
"*:/platform/administrators",
"*:/platform/web-contributors"
],
"system":true
},
Expand All @@ -377,7 +369,8 @@
"en":"layout.portletInstance.UserSettingNotifications.description"
},
"permissions":[
"*:/platform/users"
"*:/platform/administrators",
"*:/platform/web-contributors"
],
"system":true
},
Expand All @@ -392,7 +385,8 @@
"en":"layout.portletInstance.UserSettingSecurity.description"
},
"permissions":[
"*:/platform/users"
"*:/platform/administrators",
"*:/platform/web-contributors"
],
"system":true
},
Expand All @@ -407,7 +401,8 @@
"en":"layout.portletInstance.ProfileAboutMe.description"
},
"permissions":[
"*:/platform/users"
"*:/platform/administrators",
"*:/platform/web-contributors"
],
"system":true
},
Expand All @@ -422,7 +417,8 @@
"en":"layout.portletInstance.ProfileContactInformation.description"
},
"permissions":[
"*:/platform/users"
"*:/platform/administrators",
"*:/platform/web-contributors"
],
"system":true
},
Expand All @@ -437,7 +433,8 @@
"en":"layout.portletInstance.ProfileHeader.description"
},
"permissions":[
"*:/platform/users"
"*:/platform/administrators",
"*:/platform/web-contributors"
],
"system":true
},
Expand All @@ -452,7 +449,8 @@
"en":"layout.portletInstance.ProfileWorkExperience.description"
},
"permissions":[
"*:/platform/users"
"*:/platform/administrators",
"*:/platform/web-contributors"
],
"system":true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,7 @@ private PortletInstance newPortletInstance() {
Collections.singletonList("Everyone"),
Collections.singletonList("edit"),
true,
false,
true);
false);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,6 @@ layout.category.placeholder=Select a category
layout.portlet=Portlet
layout.portlet.placeholder=Select a portlet

layout.portlet.allowUsingInSpaceContext=Allow space hosts use it for space apps

layout.portletInstance.add=Add

layout.portletInstanceCategoryCreatedSuccessfully=Portlet Instance Category created successfully
Expand All @@ -295,5 +293,10 @@ portlets.noPreviewAvailable=No preview available
portlets.switchToEditMode=Edit mode
portlets.switchToViewMode=View mode
portlets.emptyPortletInstanceContent=Empty portlet instance
portlets.selectWhoCanAddIt=Select who can add it inside a page
portlets.administratorsMandatorySelectionTooltip=Admin has to access this app
portlets.administrators=Administrators
portlets.contentManagers=Content Managers
portlets.spaceHost=Space Host

layout.editPortletInstance=Edit portlet instance {0}
layout.editPortletInstance=Edit portlet instance {0}
Loading

0 comments on commit f224bdd

Please sign in to comment.