Changeset 52696
- Timestamp:
- 03/27/08 14:59:50 (2 years ago)
- Files:
-
- CPS3/products/CPSDefault/trunk/CHANGES (modified) (1 diff)
- CPS3/products/CPSDefault/trunk/profiles/default/roots/sections/rolemap.xml (modified) (1 diff)
- CPS3/products/CPSDefault/trunk/profiles/default/roots/workspaces/rolemap.xml (modified) (1 diff)
- CPS3/products/CPSPortlets/trunk/CHANGES (modified) (1 diff)
- CPS3/products/CPSPortlets/trunk/PortletsTool.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
CPS3/products/CPSDefault/trunk/CHANGES
r52681 r52696 7 7 Bug fixes 8 8 ~~~~~~~~~ 9 - 9 - #1899: Workspace members cannot create blogs. 10 10 New internal features 11 11 ~~~~~~~~~~~~~~~~~~~~~ CPS3/products/CPSDefault/trunk/profiles/default/roots/sections/rolemap.xml
r50811 r52696 40 40 <role name="Manager"/> 41 41 <role name="SectionManager"/> 42 <role name="Owner"/> 42 43 </permission> 43 44 <permission name="Modify Folder Properties" acquire="False"> CPS3/products/CPSDefault/trunk/profiles/default/roots/workspaces/rolemap.xml
r32885 r52696 38 38 <role name="Manager"/> 39 39 <role name="WorkspaceManager"/> 40 <role name="Owner"/> 40 41 </permission> 41 42 <permission name="Modify Folder Properties" acquire="False"> CPS3/products/CPSPortlets/trunk/CHANGES
r52684 r52696 7 7 Bug fixes 8 8 ~~~~~~~~~ 9 - 9 - #1899: Workspace members cannot create blogs. 10 10 New internal features 11 11 ~~~~~~~~~~~~~~~~~~~~~ CPS3/products/CPSPortlets/trunk/PortletsTool.py
r52458 r52696 1 1 # -*- coding: ISO-8859-15 -*- 2 # Copyright (c) 2004-200 7Nuxeo SAS <http://nuxeo.com>2 # Copyright (c) 2004-2008 Nuxeo SAS <http://nuxeo.com> 3 3 # Copyright (c) 2004-2006 Chalmers University of Technology <http://www.chalmers.se> 4 4 # Authors : … … 516 516 security.declareProtected(View, 'createPortlet') 517 517 def createPortlet(self, ptype_id, context=None, **kw): 518 """Create a new portlet 519 520 Check where it has to be created globally within the tool or locally 521 within the PortletsTool. It's done byt checking the context. If context 522 is None then it's global otherweise we gonne look at the context to get 523 the portal ocontainer 524 525 returns the id of the new portlet within portal_portlets or Portlet 526 Container or None if something happend 527 """ 528 529 # XXX possible to cope with that in a better way ? 530 if not _checkPermission(ManagePortlets, context): 531 raise Unauthorized( 532 "You are not allowed to create portlets within %s" %( 533 context.absolute_url())) 518 """Create a new portlet. 519 520 If context is None the portlet is created within the PortletsTool 521 (portal_portlets), otherwise the portlet is created locally in portlet 522 container of the given context. 523 524 Returns the id of the newly created portlet or None if something has 525 failed. 526 """ 527 # Determine where the portlet has to be created 528 if context is None: 529 if not _checkPermission(ManagePortlets, self): 530 raise Unauthorized( 531 "You are not allowed to globally create portlets") 532 533 # Here, it's within the tool 534 destination = self 535 else: 536 if not _checkPermission(ManagePortlets, context): 537 raise Unauthorized( 538 "You are not allowed to locally create portlets within %s" 539 % (context.absolute_url())) 540 destination = self.getPortletContainer(context=context, create=1) 534 541 535 542 # Check if the ptype_id is valid 536 543 if ptype_id not in self.listPortletTypes(): 537 544 return None 538 539 # Check where we gonna create the portlet540 if context is None:541 # Here it's within the tool542 destination = self543 else:544 destination = self.getPortletContainer(context=context, create=1)545 545 546 546 portlet_id = destination._createPortlet(ptype_id, **kw)
