@Activate
public void activate(BundleContext bundleContext) {
Dictionary<String, Object> properties = new HashMapDictionary<>();
properties.put("model.class.name", JournalFolder.class.getName());
_serviceRegistration = bundleContext.registerService(
ModelResourcePermission.class,
ModelResourcePermissionFactory.create(
JournalFolder.class, JournalFolder::getFolderId,
_journalFolderLocalService::getFolder,
_portletResourcePermission,
(modelResourcePermission, consumer) -> {
consumer.accept(
new StagedModelPermissionLogic<>(
_stagingPermission, JournalPortletKeys.JOURNAL,
JournalFolder::getFolderId));
consumer.accept(
new DynamicInheritancePermissionLogic<>(
modelResourcePermission, _getFetchParentFunction(),
false));
},
actionId -> {
if (ActionKeys.ADD_FOLDER.equals(actionId)) {
return ActionKeys.ADD_SUBFOLDER;
}
return actionId;
}),
properties);
}