r252489 - in collective.portlet.mybookmarks/trunk: . collective/portlet/mybookmarks collective/portlet/mybookmarks/profiles/default docs

"Andrea Cecchi" <svn-changes-z4DKO/[email protected]>
Newsgroups gmane.comp.web.zope.plone.collective.cvs
Message-ID <[email protected]>
Author: micecchi
Date: Wed Jul 17 08:41:44 2013
New Revision: 252489

Modified:
   collective.portlet.mybookmarks/trunk/collective/portlet/mybookmarks/configure.zcml
   collective.portlet.mybookmarks/trunk/collective/portlet/mybookmarks/profiles/default/metadata.xml
   collective.portlet.mybookmarks/trunk/collective/portlet/mybookmarks/profiles/default/rolemap.xml
   collective.portlet.mybookmarks/trunk/collective/portlet/mybookmarks/upgrades.py
   collective.portlet.mybookmarks/trunk/collective/portlet/mybookmarks/upgrades.zcml
   collective.portlet.mybookmarks/trunk/docs/HISTORY.txt
   collective.portlet.mybookmarks/trunk/setup.py
Log:
added custom permission to create portlet

Modified: collective.portlet.mybookmarks/trunk/collective/portlet/mybookmarks/configure.zcml
==============================================================================
--- collective.portlet.mybookmarks/trunk/collective/portlet/mybookmarks/configure.zcml	(original)
+++ collective.portlet.mybookmarks/trunk/collective/portlet/mybookmarks/configure.zcml	Wed Jul 17 08:41:44 2013
@@ -21,6 +21,11 @@
         title="collective.portlet.mybookmarks: Remove User Bookmark"
         />
   
+  <permission
+      id="collective.portlet.mybookmarks.AddMyBookmarksPortlet"
+      title="collective.portlet.mybookmarks: Add mybookmarks portlet"
+     /> 
+
 	<include package=".browser" />
   <include file="upgrades.zcml" />
 
@@ -38,6 +43,7 @@
          name="collective.portlet.mybookmarks.MyBookmarksPortlet"
          interface=".mybookmarksportlet.IMyBookmarksPortlet"
          assignment=".mybookmarksportlet.Assignment"
+         edit_permission="collective.portlet.mybookmarks.AddMyBookmarksPortlet"
          view_permission="zope2.View"
          renderer=".mybookmarksportlet.Renderer"
          addview=".mybookmarksportlet.AddForm"

Modified: collective.portlet.mybookmarks/trunk/collective/portlet/mybookmarks/profiles/default/metadata.xml
==============================================================================
--- collective.portlet.mybookmarks/trunk/collective/portlet/mybookmarks/profiles/default/metadata.xml	(original)
+++ collective.portlet.mybookmarks/trunk/collective/portlet/mybookmarks/profiles/default/metadata.xml	Wed Jul 17 08:41:44 2013
@@ -1,4 +1,4 @@
 <?xml version="1.0"?>
 <metadata>
-  <version>1</version>
+  <version>2</version>
 </metadata>

Modified: collective.portlet.mybookmarks/trunk/collective/portlet/mybookmarks/profiles/default/rolemap.xml
==============================================================================
--- collective.portlet.mybookmarks/trunk/collective/portlet/mybookmarks/profiles/default/rolemap.xml	(original)
+++ collective.portlet.mybookmarks/trunk/collective/portlet/mybookmarks/profiles/default/rolemap.xml	Wed Jul 17 08:41:44 2013
@@ -1,14 +1,15 @@
 <?xml version="1.0"?>
 <rolemap>
   <permissions>
-  
-     <permission name="collective.portlet.mybookmarks: Add User Bookmark" acquire="True">
+    <permission name="collective.portlet.mybookmarks: Add mybookmarks portlet" acquire="True">
+      <role name="Manager"/>
+      <role name="Site Administrator"/>
+    </permission>
+    <permission name="collective.portlet.mybookmarks: Add User Bookmark" acquire="True">
        <role name="Authenticated"/>
-     </permission>
-	 
-	 <permission name="collective.portlet.mybookmarks: Remove User Bookmark" acquire="True">
+    </permission>
+    <permission name="collective.portlet.mybookmarks: Remove User Bookmark" acquire="True">
        <role name="Authenticated"/>
-     </permission>
-   
+    </permission>
   </permissions>
-</rolemap>
\ No newline at end of file
+</rolemap>

Modified: collective.portlet.mybookmarks/trunk/collective/portlet/mybookmarks/upgrades.py
==============================================================================
--- collective.portlet.mybookmarks/trunk/collective/portlet/mybookmarks/upgrades.py	(original)
+++ collective.portlet.mybookmarks/trunk/collective/portlet/mybookmarks/upgrades.py	Wed Jul 17 08:41:44 2013
@@ -21,5 +21,15 @@
     Upgrades to 1.2.0 version: add default bookmarks configuration
     """
     logger.info('Upgrading collective.portlet.mybookmarks to version 1')
-    context.runImportStepFromProfile('profile-collective.portlet.mybookmarks:default', 'mybookmarks.importvarious')
+    context.runImportStepFromProfile(default_profile, 'mybookmarks.importvarious')
+    logger.info('Reinstalled My Bookmark Portlet')
+
+
+@upgrade('collective.portlet.mybookmarks', '1.3.2')
+def to_2(context):
+    """
+    Upgrades to 1.3.2 version: add new permission to add the portlet
+    """
+    logger.info('Upgrading collective.portlet.mybookmarks to version 2')
+    context.runImportStepFromProfile(default_profile, 'rolemap')
     logger.info('Reinstalled My Bookmark Portlet')

Modified: collective.portlet.mybookmarks/trunk/collective/portlet/mybookmarks/upgrades.zcml
==============================================================================
--- collective.portlet.mybookmarks/trunk/collective/portlet/mybookmarks/upgrades.zcml	(original)
+++ collective.portlet.mybookmarks/trunk/collective/portlet/mybookmarks/upgrades.zcml	Wed Jul 17 08:41:44 2013
@@ -7,9 +7,16 @@
   <gs:upgradeStep
         title="Upgrade collective.portlet.mybookmarks"
         description="collective.portlet.mybookmarks upgrade step"
-        source="*"
+        source="0"
         destination="1"
         handler=".upgrades.to_1"
         profile="collective.portlet.mybookmarks:default" />
-
+  
+  <gs:upgradeStep
+        title="Upgrade collective.portlet.mybookmarks"
+        description="collective.portlet.mybookmarks upgrade step"
+        source="1"
+        destination="2"
+        handler=".upgrades.to_2"
+        profile="collective.portlet.mybookmarks:default" />
 </configure>
\ No newline at end of file

Modified: collective.portlet.mybookmarks/trunk/docs/HISTORY.txt
==============================================================================
--- collective.portlet.mybookmarks/trunk/docs/HISTORY.txt	(original)
+++ collective.portlet.mybookmarks/trunk/docs/HISTORY.txt	Wed Jul 17 08:41:44 2013
@@ -4,14 +4,12 @@
 1.3.2 (unreleased)
 ------------------
 
-- Nothing changed yet.
-
+* Added separated permission to add the portlet [cekk]
 
 1.3.1 (2013-07-08)
 ------------------
 
-- Fixed portlet footer [cekk]
-
+* Fixed portlet footer [cekk]
 
 1.3.0 (2012-08-23)
 ------------------

Modified: collective.portlet.mybookmarks/trunk/setup.py
==============================================================================
--- collective.portlet.mybookmarks/trunk/setup.py	(original)
+++ collective.portlet.mybookmarks/trunk/setup.py	Wed Jul 17 08:41:44 2013
@@ -1,7 +1,7 @@
 from setuptools import setup, find_packages
 import os
 
-version = '1.3.2.dev0'
+version = '1.3.2'
 
 setup(name='collective.portlet.mybookmarks',
       version=version,

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.