Skip to content

Commit

Permalink
Merge pull request #39 from eea/develop
Browse files Browse the repository at this point in the history
Release: Custom add permissions for IMS Indicator content-type
  • Loading branch information
avoinea authored Dec 13, 2023
2 parents 0a62e5d + 6169101 commit 53269cd
Show file tree
Hide file tree
Showing 14 changed files with 73 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Develop
git checkout https://github.com/eea/eea.dexterity.indicators.git
cd eea.dexterity.indicators
git checkout develop
docker-compose up
docker compose up


Install
Expand Down
5 changes: 5 additions & 0 deletions docs/HISTORY.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

9.5 - (2023-12-13)
---------------------------
* Feature: Custom add permissions for IMS Indicator content-type
[avoinea - refs #259400]

9.4 - (2023-10-30)
---------------------------
* Feature: Custom Indicator @indexers for data_provenance and temportal_coverage
Expand Down
1 change: 1 addition & 0 deletions eea/dexterity/indicators/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

<i18n:registerTranslations directory="locales" />

<include file="permissions.zcml" />
<include file="profiles.zcml" />
<include package=".behaviors" />
<include package=".browser" />
Expand Down
12 changes: 12 additions & 0 deletions eea/dexterity/indicators/permissions.zcml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:zcml="http://namespaces.zope.org/zcml">

<configure zcml:condition="installed AccessControl.security">
<permission
id="eea.dexterity.indicators.addIndicator"
title="IMS: Add Indicator"
/>
</configure>

</configure>
8 changes: 8 additions & 0 deletions eea/dexterity/indicators/profiles.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
post_handler=".setuphandlers.uninstall"
/>

<genericsetup:registerProfile
name="upgrade_95"
title="Upgrade profile for eea.dexterity.indicators 9.5"
description=""
directory="profiles/upgrades/to_95"
provides="Products.GenericSetup.interfaces.EXTENSION"
/>

<utility
factory=".setuphandlers.HiddenProfiles"
name="eea.dexterity.indicators-hiddenprofiles"
Expand Down
2 changes: 1 addition & 1 deletion eea/dexterity/indicators/profiles/default/metadata.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<version>6.0</version>
<version>9.5</version>
</metadata>
11 changes: 11 additions & 0 deletions eea/dexterity/indicators/profiles/default/rolemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<rolemap>
<permissions>
<permission name="IMS: Add Indicator" acquire="True">
<role name="Manager"/>
<role name="Site Administrator"/>
<role name="Owner"/>
<role name="Contributor"/>
</permission>
</permissions>
</rolemap>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<element value="view"/>
</property>
<property name="default_view_fallback">False</property>
<property name="add_permission">cmf.AddPortalContent</property>
<property name="add_permission">eea.dexterity.indicators.addIndicator</property>
<property name="klass">plone.dexterity.content.Container</property>
<property name="behaviors">
<element value="collective.taxonomy.generated.dpsir"/>
Expand Down
11 changes: 11 additions & 0 deletions eea/dexterity/indicators/profiles/upgrades/to_95/rolemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<rolemap>
<permissions>
<permission name="IMS: Add Indicator" acquire="True">
<role name="Manager"/>
<role name="Site Administrator"/>
<role name="Owner"/>
<role name="Contributor"/>
</permission>
</permissions>
</rolemap>
4 changes: 4 additions & 0 deletions eea/dexterity/indicators/profiles/upgrades/to_95/types.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0"?>
<object name="portal_types">
<object name="ims_indicator" meta_type="Dexterity FTI"/>
</object>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0"?>
<object name="ims_indicator" meta_type="Dexterity FTI">
<property name="add_permission">eea.dexterity.indicators.addIndicator</property>
</object>
1 change: 1 addition & 0 deletions eea/dexterity/indicators/setuphandlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def getNonInstallableProfiles(self):
"""
return [
'eea.dexterity.indicators:uninstall',
'eea.dexterity.indicators:upgrade_95',
]


Expand Down
12 changes: 12 additions & 0 deletions eea/dexterity/indicators/upgrades/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,16 @@

</genericsetup:upgradeSteps>

<genericsetup:upgradeSteps
source="6.0"
destination="9.5"
profile="eea.dexterity.indicators:default">

<genericsetup:upgradeDepends
title="Custom add permission for IMS indicator"
import_profile="eea.dexterity.indicators:upgrade_95"
/>

</genericsetup:upgradeSteps>

</configure>
2 changes: 1 addition & 1 deletion eea/dexterity/indicators/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9.4
9.5

0 comments on commit 53269cd

Please sign in to comment.