Changeset 52696

Show
Ignore:
Timestamp:
03/27/08 14:59:50 (2 years ago)
Author:
madarche
Message:

Fixed #1899: Workspace members cannot create blogs.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • CPS3/products/CPSDefault/trunk/CHANGES

    r52681 r52696  
    77Bug fixes 
    88~~~~~~~~~ 
    9 - 
     9- #1899: Workspace members cannot create blogs. 
    1010New internal features 
    1111~~~~~~~~~~~~~~~~~~~~~ 
  • CPS3/products/CPSDefault/trunk/profiles/default/roots/sections/rolemap.xml

    r50811 r52696  
    4040      <role name="Manager"/> 
    4141      <role name="SectionManager"/> 
     42      <role name="Owner"/> 
    4243    </permission> 
    4344    <permission name="Modify Folder Properties" acquire="False"> 
  • CPS3/products/CPSDefault/trunk/profiles/default/roots/workspaces/rolemap.xml

    r32885 r52696  
    3838      <role name="Manager"/> 
    3939      <role name="WorkspaceManager"/> 
     40      <role name="Owner"/> 
    4041    </permission> 
    4142    <permission name="Modify Folder Properties" acquire="False"> 
  • CPS3/products/CPSPortlets/trunk/CHANGES

    r52684 r52696  
    77Bug fixes 
    88~~~~~~~~~ 
    9 - 
     9- #1899: Workspace members cannot create blogs. 
    1010New internal features 
    1111~~~~~~~~~~~~~~~~~~~~~ 
  • CPS3/products/CPSPortlets/trunk/PortletsTool.py

    r52458 r52696  
    11# -*- coding: ISO-8859-15 -*- 
    2 # Copyright (c) 2004-2007 Nuxeo SAS <http://nuxeo.com> 
     2# Copyright (c) 2004-2008 Nuxeo SAS <http://nuxeo.com> 
    33# Copyright (c) 2004-2006 Chalmers University of Technology <http://www.chalmers.se> 
    44# Authors : 
     
    516516    security.declareProtected(View, 'createPortlet') 
    517517    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) 
    534541 
    535542        # Check if the ptype_id is valid 
    536543        if ptype_id not in self.listPortletTypes(): 
    537544            return None 
    538  
    539         # Check where we gonna create the portlet 
    540         if context is None: 
    541             # Here it's within the tool 
    542             destination = self 
    543         else: 
    544             destination = self.getPortletContainer(context=context, create=1) 
    545545 
    546546        portlet_id = destination._createPortlet(ptype_id, **kw)