Changeset 32f43b in indico


Ignore:
Timestamp:
03/28/12 17:51:46 (14 months ago)
Author:
Jose Benito <jose.benito.gonzalez@…>
Branches:
master, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, d9941f8582b36b24821a11ea5ba16fda6a457fb1
Children:
20016b
Parents:
a20e62
git-author:
Alberto Resco Perez <alberto.resco.perez@…> (03/16/12 17:20:42)
git-committer:
Jose Benito <jose.benito.gonzalez@…> (03/28/12 17:51:46)
Message:

[IMP] Add protection section in admin

  • The disclaimers for restricted and protected are stored in minfo.
Location:
indico
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/common/info.py

    rf0754f r32f43b  
    3030DEFAULT_API_USER_AGREEMENT = """In order to enable an iCal export link, your account needs to have a key created. This key enables other applications to access data from within Indico even when you are neither using nor logged into the Indico system yourself with the link provided. Once created, you can manage your key at any time by going to 'My Profile' and looking under the tab entitled 'HTTP API'. Further information about HTTP API keys can be found in the Indico documentation.""" 
    3131DEFAULT_PERSISTENT_USER_AGREEMENT = """In conjunction with a having a key associated with your account, to have the possibility of exporting private event information necessitates the creation of a persistent key.  This new key is also associated with your account and whilst it is active the data which can be obtained through using this key can be obtained by anyone in possession of the link provided. Due to this reason, it is extremely important that you keep links generated with this key private and for your use only. If you think someone else may have acquired access to a link using this key in the future, you must immediately remove it from 'My Profile' under the 'HTTP API' tab and generate a new key before regenerating iCalendar links.""" 
     32DEFAULT_PROTECTION_DISCLAINER_RESTRICTED = 'Circulation to people other than the intended audience is not authorized. You are obliged to treat the information with the appropriate level of confidentiality.' 
     33DEFAULT_PROTECTION_DISCLAINER_PROTECTED = 'As such, this information is intended for an internal audience only. You are obliged to treat the information with the appropriate level of confidentiality.' 
    3234 
    3335#from MaKaC.common.logger import Logger 
     
    105107        self._apiPersistentUserAgreement = DEFAULT_PERSISTENT_USER_AGREEMENT 
    106108 
     109        self._protectionDisclaimerRestricted = DEFAULT_PROTECTION_DISCLAINER_RESTRICTED 
     110        self._protectionDisclaimerProtected = DEFAULT_PROTECTION_DISCLAINER_PROTECTED 
     111 
    107112 
    108113    def getStyleManager( self ): 
     
    511516    def setAPIPersistentUserAgreement(self, v): 
    512517        self._apiPersistentUserAgreement = v 
     518 
     519    def getProtectionDisclaimerProtected(self): 
     520        if not hasattr(self, '_protectionDisclaimerProtected'): 
     521            self._protectionDisclaimerProtected = DEFAULT_PROTECTION_DISCLAINER_PROTECTED 
     522        return self._protectionDisclaimerProtected 
     523 
     524    def setProtectionDisclaimerProtected(self, v): 
     525        self._protectionDisclaimerProtected = v 
     526 
     527    def getProtectionDisclaimerRestricted(self): 
     528        if not hasattr(self, '_protectionDisclaimerRestricted'): 
     529            self._protectionDisclaimerRestricted = DEFAULT_PROTECTION_DISCLAINER_RESTRICTED 
     530        return self._protectionDisclaimerRestricted 
     531 
     532    def setProtectionDisclaimerRestricted(self, v): 
     533        self._protectionDisclaimerRestricted = v 
    513534 
    514535 
  • indico/MaKaC/services/implementation/admin.py

    rd9e5b0 r32f43b  
    1818## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. 
    1919 
    20 from MaKaC.services.implementation.base import AdminService 
     20from MaKaC.services.implementation.base import AdminService, TextModificationBase 
     21 
    2122from MaKaC.services.implementation.base import ParameterManager 
    2223from MaKaC.user import PrincipalHolder, AvatarHolder, GroupHolder 
     
    190191        return userFossil 
    191192 
     193class EditProtectionDisclaimerProtected (TextModificationBase, AdminService): 
     194 
     195    def _handleSet(self): 
     196        if (self._value ==""): 
     197            raise ServiceError("ERR-E1", 
     198                               "The protected disclaimer cannot be empty") 
     199        minfo = info.HelperMaKaCInfo.getMaKaCInfoInstance() 
     200        minfo.setProtectionDisclaimerProtected(self._value) 
     201 
     202    def _handleGet(self): 
     203        minfo = info.HelperMaKaCInfo.getMaKaCInfoInstance() 
     204        return minfo.getProtectionDisclaimerProtected() 
     205 
     206class EditProtectionDisclaimerRestricted (TextModificationBase, AdminService): 
     207 
     208    def _handleSet(self): 
     209        if (self._value ==""): 
     210            raise ServiceError("ERR-E1", 
     211                               "The restricted disclaimer cannot be empty") 
     212        minfo = info.HelperMaKaCInfo.getMaKaCInfoInstance() 
     213        minfo.setProtectionDisclaimerRestricted(self._value) 
     214 
     215    def _handleGet(self): 
     216        minfo = info.HelperMaKaCInfo.getMaKaCInfoInstance() 
     217        return minfo.getProtectionDisclaimerRestricted() 
    192218 
    193219methodMap = { 
     
    203229    "groups.removeMember": GroupRemoveMember, 
    204230 
    205     "merge.getCompleteUserInfo": MergeGetCompleteUserInfo 
     231    "merge.getCompleteUserInfo": MergeGetCompleteUserInfo, 
     232 
     233    "protection.editProtectionDisclaimerProtected": EditProtectionDisclaimerProtected, 
     234    "protection.editProtectionDisclaimerRestricted": EditProtectionDisclaimerRestricted 
    206235} 
  • indico/MaKaC/webinterface/pages/admins.py

    r4a686c r32f43b  
    120120            urlHandlers.UHAdminsSystem.getURL()) 
    121121        mainSection.addItem( self._systemMenuItem) 
     122 
     123        self._protectionMenuItem = wcomponents.SideMenuItem(_("Protection"), 
     124            urlHandlers.UHAdminsProtection.getURL()) 
     125        mainSection.addItem( self._protectionMenuItem) 
    122126 
    123127        self._sideMenu.addSection(mainSection) 
     
    26412645        vars["analyticsFormURL"] = urlHandlers.UHSaveAnalytics.getURL() 
    26422646        return vars 
     2647 
     2648class WPAdminProtection( WPAdminsBase ): 
     2649 
     2650    def _setActiveSideMenuItem(self): 
     2651        self._protectionMenuItem.setActive() 
     2652 
     2653    def _getPageContent( self, params ): 
     2654        wc = WAdminProtection() 
     2655        return wc.getHTML() 
     2656 
     2657class WAdminProtection(wcomponents.WTemplated): 
     2658 
     2659    def getVars( self ): 
     2660        vars = wcomponents.WTemplated.getVars( self ) 
     2661        minfo = info.HelperMaKaCInfo.getMaKaCInfoInstance() 
     2662        vars["protectionDisclaimerProtected"] = minfo.getProtectionDisclaimerProtected() 
     2663        vars["protectionDisclaimerRestricted"] = minfo.getProtectionDisclaimerRestricted() 
     2664        return vars 
  • indico/MaKaC/webinterface/rh/admins.py

    r7910eb r32f43b  
    592592        p = admins.WPAdminsConferenceStyles( self ) 
    593593        return p.display() 
     594 
     595class RHAdminProtection( RHAdminBase ): 
     596    _uh = urlHandlers.UHDomains 
     597 
     598    def _checkParams( self, params ): 
     599        RHAdminBase._checkParams( self, params ) 
     600 
     601    def _process( self ): 
     602        p = admins.WPAdminProtection( self ) 
     603        return p.display() 
  • indico/MaKaC/webinterface/tpls/ProtectionWidget.tpl

    rbbbf7f r32f43b  
    22<div id="protectionWidget" style="display:none" class="protectionWidget"> 
    33    <div class="protectionWidgetSection"> 
    4         <div>${_("The information here displayed is")} 
    5         <span class="protectionHighlight${protection[0]}">${protection[1].upper()}</span><br/></div> 
    6         <div style="padding-top:10px; text-align:justify"> 
    7             ${_("""The elements on this page are no viewable by the general public. The <a href="https://security.web.cern.ch/" target="blank">CERN Security Policy</a> binds you to treat such data confidientially as denoted in the policy itself.""")} 
    8         </div> 
     4        % if protection[0] == "Protected": 
     5            ${_("The information on this web page is restricted for display on the %s") % protection[1]} 
     6        % else: 
     7            ${_("The information on this web page is restricted for display to named individuals or specific groups.")} 
     8        % endif 
     9    </div> 
     10    <div class="protectionWidgetSection"> 
     11        % if protection[0] == "Protected": 
     12            ${protectionDisclaimerProtected} 
     13        % else: 
     14            ${protectionDisclaimerRestricted} 
     15        % endif 
    916    </div> 
    1017    <div class="protectionWidgetSection"> 
     
    2330 
    2431    style: { 
    25         width: '200px', 
     32        width: '250px', 
    2633        classes: 'ui-tooltip-rounded ui-tooltip-shadow ui-tooltip-popup', 
    2734        tip: { 
  • indico/MaKaC/webinterface/tpls/SessionBar.tpl

    ra20e62 r32f43b  
    99%> 
    1010 
    11 <div id="sessionBar" class="ui-follow-scroll sessionBar${" sessionBarDark" if dark_ == True else ""}"> 
     11<div id="sessionBar" class="${'ui-follow-scroll' if target and not isFrontPage and protection[0] != 'Public' else ''} sessionBar${" sessionBarDark" if dark_ == True else ""}"> 
    1212    % if isFrontPage or not target or protection == "Public": 
    1313        <div class="corner"></div> 
  • indico/MaKaC/webinterface/urlHandlers.py

    r0ef4a4 r32f43b  
    19521952class UHAdminsSystemModif( URLHandler ): 
    19531953    _relativeURL = "adminSystem.py/modify" 
     1954 
     1955class UHAdminsProtection( URLHandler ): 
     1956    _relativeURL = "adminProtection.py" 
    19541957 
    19551958class UHMaterialModification( URLHandler ): 
  • indico/MaKaC/webinterface/wcomponents.py

    rbbbf7f r32f43b  
    317317    def _getProtection(self, target): 
    318318        if not target.hasAnyProtection(): 
    319             return ["Public", "Public"] 
     319            return ["Public", _("Public")] 
    320320        if target.isItselfProtected(): 
    321             return ["Restricted", "Restricted"] 
     321            return ["Restricted", _("Restricted")] 
    322322        if target.getDomainList() != []: 
    323             return ["Protected", "%s domain only"%(", ".join(map(lambda x: x.getName(), target.getDomainList())))] 
     323            return ["Protected", _("%s domain only")%(", ".join(map(lambda x: x.getName(), target.getDomainList())))] 
    324324        return self._getProtection(target.getOwner()) 
    325325 
     
    389389        minfo = info.HelperMaKaCInfo.getMaKaCInfoInstance() 
    390390        vars['roomBooking'] = minfo.getRoomBookingModuleActive() 
    391  
     391        vars['protectionDisclaimerProtected'] = minfo.getProtectionDisclaimerProtected() 
     392        vars['protectionDisclaimerRestricted'] = minfo.getProtectionDisclaimerRestricted() 
    392393        #Build a list of items for the administration menu 
    393394        adminList = AdminList.getInstance() 
Note: See TracChangeset for help on using the changeset viewer.