Changeset 30058

Show
Ignore:
Timestamp:
11/28/05 19:49:00 (4 years ago)
Author:
ogrisel
Message:

Zope level users and anonymous users are explicitely homeless

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • CPSCore/trunk/CHANGES

    r30045 r30058  
    1313- PatchCatalogTool new wrapper index position_in_container and match_languages 
    1414  used by getCatalogFolderContents. 
    15 - new Proxy method isCPSFolderish to filter documents in the navigation  
     15- new Proxy method isCPSFolderish to filter documents in the navigation 
    1616  or listing representation. 
     17- Zope level users and anonymous users are explicitely homeless 
  • CPSCore/trunk/CPSMembershipTool.py

    r29023 r30058  
    126126    security = ClassSecurityInfo() 
    127127 
    128     security.declarePublic('canMemberChangeLocalRoles')     
     128    security.declarePublic('canMemberChangeLocalRoles') 
    129129    def canMemberChangeLocalRoles(self, context): 
    130130        """Can the authenticated member change the local roles 
    131131        """ 
    132132        user = getSecurityManager().getUser() 
    133         return (user.has_role('Manager') or  
     133        return (user.has_role('Manager') or 
    134134                user.has_role(self.roles_managing_local_roles, context)) 
    135135 
     
    434434    security.declarePublic('isHomeless') 
    435435    def isHomeless(self, member=None): 
    436         """Return 1 if member have no home using homeless attribute.""" 
     436        """Return 1 if member have no home using homeless attribute. 
     437 
     438        Anonymous users and users registered above CPS level are homeless. 
     439        """ 
    437440        ret = 0 
    438441        if member is None: 
    439442            member = self.getAuthenticatedMember() 
     443        if member.getUserName() == "Anonymous User": 
     444            return 1 
     445        # users registered above the portal level are homeless 
     446        member_acl_users = aq_parent(aq_inner(member.getUser())) 
     447        if aq_base(member_acl_users) is not aq_base(self.acl_users): 
     448            return 1 
    440449 
    441450        if hasattr(member, 'getProperty'):