Changeset ca8a8d in indico


Ignore:
Timestamp:
08/08/11 12:08:32 (22 months ago)
Author:
Jose Benito <jose.benito.gonzalez@…>
Branches:
master, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 0da0c1403bae8e51d8229f460181c71b9e6dda72
Children:
dea114
Parents:
fc5f5b
git-author:
Jose Benito <jose.benito.gonzalez@…> (08/08/11 12:07:46)
git-committer:
Jose Benito <jose.benito.gonzalez@…> (08/08/11 12:08:32)
Message:

[FIX] Refactor canAccess method

Location:
indico/MaKaC
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/conference.py

    rfc5f5b rca8a8d  
    37933793        if self.__ac.isHarvesterIP(aw.getIP()): 
    37943794            return True 
    3795         ##################################################### 
    3796         if self.getAccessKey()!= "": 
    3797             if self.canKeyAccess( aw ) and not self.canUserModify(aw.getUser()) and not self.isAllowedToAccess( aw.getUser() ): 
    3798                 return False 
    3799         elif not self.canIPAccess(aw.getIP()) and not self.canUserModify(aw.getUser()) and not self.isAllowedToAccess( aw.getUser() ): 
    3800             return False 
    3801         if not self.isProtected(): 
    3802             return True 
    3803         return self.isAllowedToAccess( aw.getUser() ) 
     3795 
     3796        if self.isProtected(): 
     3797            if self.canUserModify(aw.getUser()) or self.isAllowedToAccess( aw.getUser() ): 
     3798                return True 
     3799            else: 
     3800                return self.canKeyAccess(aw) 
     3801        else: 
     3802            return self.canIPAccess(aw.getIP()) 
    38043803 
    38053804    def canKeyAccess( self, aw, key=None ): 
  • indico/MaKaC/plugins/Collaboration/pages.py

    r35c7ed rca8a8d  
    6969        vars['getBookingType'] = WEventDetailBanner.getBookingType 
    7070        vars['formatTwoDates'] = formatTwoDates 
     71        return vars 
    7172 
    7273 
  • indico/MaKaC/webinterface/pages/errors.py

    r34d140 rca8a8d  
    208208 
    209209    def _getBody( self, params ): 
    210         if self._rh._target and (self._rh._target.getAccessKey() != "" or ( (not type(self._rh._target) is Category) and self._rh._target.getConference().getAccessKey() != "")): 
     210        tgt = self._rh._target 
     211        if tgt and tgt.isProtected() and (tgt.getAccessKey() != "" or \ 
     212                                          ( (not type(tgt) is Category) and tgt.getConference().getAccessKey() != "")): 
    211213            msg = "" 
    212214            sess = self._rh._getSession() 
    213215            keys = sess.getVar("accessKeys") 
    214             id = self._rh._target.getUniqueId() 
     216            id = tgt.getUniqueId() 
    215217            if keys != None and keys.has_key(id): 
    216218                msg = i18nformat("""<font color=red> _("Bad access key")!</font>""") 
  • indico/MaKaC/webinterface/tpls/ConfAccessControlFrame.tpl

    rc0de5a rca8a8d  
    1010    parentPrivacy=parentPrivacy, statusColor = statusColor, parentStatusColor=parentStatusColor, 
    1111    locator=locator, isFullyPublic=isFullyPublic"/> 
     12    % if privacy != 'PUBLIC': 
    1213    <tr> 
    1314        <td class="titleCellTD"><span class="titleCellFormat">${ _("Access key")}</span></td> 
     
    4950        </td> 
    5051    </tr> 
     52    % endif 
    5153</table> 
Note: See TracChangeset for help on using the changeset viewer.