Example #1
0
 def _checkProtection(self):
     if self._target.hasEnabledSection("paperReviewing"):
         if not RCPaperReviewManager.hasRights(self):
             RHConferenceModifBase._checkProtection(self)
     else:
         raise MaKaCError(
             _("Paper Reviewing is not active for this conference"))
Example #2
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     self.session = None
     if 'session_id' in request.view_args:
         self.session = self.event_new.get_session(request.view_args['session_id'])
         if self.session is None:
             raise NotFound
Example #3
0
    def _checkProtection(self):
        if not PluginsHolder().hasPluginType("statistics"):
            raise PluginError(_("Statistics plugin is not active."))

        self._checkSessionUser()

        RHConferenceModifBase._checkProtection(self)
Example #4
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     try:
         self.event_id = int(self._conf.id)
     except ValueError:
         raise IndicoError(_('This page is not available for legacy events.'))
     self.event = self._conf
Example #5
0
    def _checkProtection(self):
        if not PluginsHolder().hasPluginType("statistics"):
            raise PluginError(_("Statistics plugin is not active."))

        self._checkSessionUser()

        RHConferenceModifBase._checkProtection(self)
Example #6
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     self._isPRM = RCPaperReviewManager.hasRights(self)
     self._isReferee = RCReferee.hasRights(self)
     self._isReviewingStaff = RCReviewingStaff.hasRights(self)
     self._isEditor = RCEditor.hasRights(self)
     self._isReviewer = RCReviewer.hasRights(self)
Example #7
0
    def _checkParams(self, params):
        RHConferenceModifBase._checkParams(self, params)

        self._activeTabName = params.get("tab", None)

        # we build the list 'allowedTabs', a list of all tabs that the user can see
        allowedTabs = CollaborationTools.getTabs(self._conf, self._getUser())

        if self._target.canModify(self.getAW()) or RCVideoServicesManager.hasRights(self):
            allowedTabs.append('Managers')

        tabOrder = CollaborationTools.getCollaborationOptionValue('tabOrder')
        self._tabs = []

        for tabName in tabOrder:
            if tabName in allowedTabs:
                self._tabs.append(tabName)
                allowedTabs.remove(tabName)

        for tabName in allowedTabs:
            if tabName != 'Managers':
                self._tabs.append(tabName)

        if 'Managers' in allowedTabs:
            self._tabs.append('Managers')
Example #8
0
    def _checkParams(self, params):
        RHConferenceModifBase._checkParams(self, params)
        
        self._activeTabName = params.get("tab", None)
        
        self._canSeeAllPluginTabs = self._target.canModify(self.getAW()) or RCCollaborationAdmin.hasRights(self) or RCVideoServicesManager.hasRights(self)
        
        # we build the list 'allowedTabs', a list of all tabs that the user can see
        if self._canSeeAllPluginTabs:
            #if the logged in user is event manager, server admin or collaboration admin: we show all plugin tabs
            allowedTabs = CollaborationTools.getTabs(self._conf)
        else:
            #else we show only the tabs of plugins of which the user is admin
            allowedTabs = CollaborationTools.getTabs(self._conf, self._getUser())
            
        if self._target.canModify(self.getAW()) or RCVideoServicesManager.hasRights(self):
            allowedTabs.append('Managers')
            
        # we order the list of allowedTabs into the self._tabs list
        tabOrder = CollaborationTools.getCollaborationOptionValue('tabOrder')
        self._tabs = []
        
        for tabName in tabOrder:
            if tabName in allowedTabs:
                self._tabs.append(tabName)
                allowedTabs.remove(tabName)
                
        for tabName in allowedTabs:
            if tabName != 'Managers':
                self._tabs.append(tabName)

        if 'Managers' in allowedTabs:
            self._tabs.append('Managers')
Example #9
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     self._isPRM = RCPaperReviewManager.hasRights(self)
     self._isReferee = RCReferee.hasRights(self)
     self._isReviewingStaff = RCReviewingStaff.hasRights(self)
     self._isEditor = RCEditor.hasRights(self)
     self._isReviewer = RCReviewer.hasRights(self)
Example #10
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     self.event = self._conf
     try:
         self.event_id = int(self.event.getId())
     except ValueError:
         raise NoReportError(_('Room booking tools are not available for legacy events.'))
Example #11
0
    def _checkParams(self, params):
        RHConferenceModifBase._checkParams(self, params)

        self._activeTabName = params.get("tab", None)

        # we build the list 'allowedTabs', a list of all tabs that the user can see
        allowedTabs = CollaborationTools.getTabs(self._conf, self._getUser())

        if self._target.canModify(
                self.getAW()) or RCVideoServicesManager.hasRights(self):
            allowedTabs.append('Managers')

        tabOrder = CollaborationTools.getCollaborationOptionValue('tabOrder')
        self._tabs = []

        for tabName in tabOrder:
            if tabName in allowedTabs:
                self._tabs.append(tabName)
                allowedTabs.remove(tabName)

        for tabName in allowedTabs:
            if tabName != 'Managers':
                self._tabs.append(tabName)

        if 'Managers' in allowedTabs:
            self._tabs.append('Managers')
Example #12
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     self.session = None
     if 'session_id' in request.view_args:
         self.session = self.event_new.get_session(
             request.view_args['session_id'])
         if self.session is None:
             raise NotFound
Example #13
0
 def _checkProtection(self):
     instantMessagingAdmins = []
     for imPlugin in PluginsHolder().getPluginType(
             'InstantMessaging').getPluginList():
         instantMessagingAdmins.extend(
             imPlugin.getOption("admins").getValue())
     if not self._getUser() in instantMessagingAdmins:
         RHConferenceModifBase._checkProtection(self)
Example #14
0
 def _checkProtection(self):
     self.protection_overridden = False
     can_modify_plugin = session.user and self.plugin.can_be_modified(session.user, self._conf)
     can_modify_event = self._conf.canModify(self.getAW())
     self.protection_overridden = can_modify_plugin and not can_modify_event
     if not can_modify_plugin and not can_modify_event:
         RHConferenceModifBase._checkProtection(self)
     return True
Example #15
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     self.event = self._conf
     try:
         self.event_id = int(self.event.getId())
     except ValueError:
         raise NoReportError(
             _('Room booking tools are not available for legacy events.'))
 def _checkProtection(self):
     if self._target.hasEnabledSection("paperReviewing"):
         confReview = self._conf.getConfReview()
         user = self.getAW().getUser()
         if not (confReview.isReferee(user) or confReview.isEditor(user) or confReview.isReviewer(user)):
             RHConferenceModifBase._checkProtection(self);
     else:
         raise MaKaCError(_("Paper Reviewing is not active for this conference"))
Example #17
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     self.target_category = Category.get_one(int(
         request.form['target_category_id']),
                                             is_deleted=False)
     if not self.target_category.can_create_events(session.user):
         raise Forbidden(
             _("You may only move events to categories where you are allowed to create events."
               ))
Example #18
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     try:
         self.definition = get_request_definitions()[request.view_args['type']]
     except KeyError:
         raise NotFound
     self.request = Request.find_latest_for_event(self.event_new, self.definition.name)
     if self._require_request and not self.request:
         raise NotFound
Example #19
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     try:
         self.definition = get_request_definitions()[request.view_args['type']]
     except KeyError:
         raise NotFound
     self.request = Request.find_latest_for_event(self.event_new, self.definition.name)
     if self._require_request and not self.request:
         raise NotFound
Example #20
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     if 'fileId' not in params:
         raise NotFoundError(_("Missing 'fileId' argument."))
     self._offlineEvent = ModuleHolder().getById("offlineEvents").getOfflineEventByFileId(params["confId"],
                                                                                          params["fileId"])
     if not self._offlineEvent or not self._offlineEvent.file or \
        not os.path.isfile(self._offlineEvent.file.getFilePath()):
         raise NotFoundError(_("The file you try to access does not exist anymore."))
Example #21
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     definition_name = request.view_args['definition']
     self.definition = get_agreement_definitions().get(definition_name)
     if self.definition is None:
         raise NotFound("Agreement type '{}' does not exist".format(definition_name))
     if not self.definition.is_active(self._conf):
         flash(_("The '{}' agreement is not used in this event.").format(self.definition.title), 'error')
         return redirect(url_for('.event_agreements', self._conf))
Example #22
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     definition_name = request.view_args['definition']
     self.definition = get_agreement_definitions().get(definition_name)
     if self.definition is None:
         raise NotFound("Agreement type '{}' does not exist".format(definition_name))
     if not self.definition.is_active(self._conf):
         flash(_("The '{}' agreement is not used in this event.").format(self.definition.title), 'error')
         return redirect(url_for('.event_agreements', self._conf))
Example #23
0
 def _checkProtection(self):
     self.protection_overridden = False
     can_modify_plugin = session.avatar and self.plugin.can_be_modified(
         session.avatar, self._conf)
     can_modify_event = self._conf.canModify(self.getAW())
     self.protection_overridden = can_modify_plugin and not can_modify_event
     if not can_modify_plugin and not can_modify_event:
         RHConferenceModifBase._checkProtection(self)
     return True
Example #24
0
    def _checkProtection(self):
        self._checkSessionUser()

        hasRights = (not self._cannotViewTab) and \
                    (RCCollaborationAdmin.hasRights(self._getUser()) or
                     RCCollaborationPluginAdmin.hasRights(self._getUser(), self._tabPlugins) or
                     RCVideoServicesManager.hasRights(self._getUser(), self._conf, self._tabPlugins) )

        if not hasRights:
            RHConferenceModifBase._checkProtection(self)
Example #25
0
 def _checkProtection(self):
     if self._target.hasEnabledSection("paperReviewing"):
         confReview = self._conf.getConfReview()
         user = self.getAW().getUser()
         if not (confReview.isReferee(user) or confReview.isEditor(user)
                 or confReview.isReviewer(user)):
             RHConferenceModifBase._checkProtection(self)
     else:
         raise MaKaCError(
             _("Paper Reviewing is not active for this conference"))
Example #26
0
File: rh.py Project: Ictp/indico
    def _checkParams(self, params):
        RHConferenceModifBase._checkParams(self, params)

        self._activeTabName = params.get("tab", None)

        self._tabs = []
        #fill the tabs with the active plugins in the Instant Messaging module
        for plugin in PluginsHolder().getPluginType('InstantMessaging').getPluginList():
            if plugin.isActive():
                self._tabs.append(plugin.getName())
Example #27
0
    def _checkProtection(self):
        self._checkSessionUser()

        hasRights = (not self._cannotViewTab) and \
                    (RCCollaborationAdmin.hasRights(self._getUser()) or
                     RCCollaborationPluginAdmin.hasRights(self._getUser(), self._tabPlugins) or
                     RCVideoServicesManager.hasRights(self._getUser(), self._conf, self._tabPlugins) )

        if not hasRights:
            RHConferenceModifBase._checkProtection(self)
Example #28
0
    def _checkProtection(self):
        if not PluginsHolder().hasPluginType("Collaboration"):
            raise PluginError("Collaboration plugin system is not active")

        hasRights = RCCollaborationAdmin.hasRights(self, None) or \
                    RCCollaborationPluginAdmin.hasRights(self, None, self._tabPlugins) or \
                    RCVideoServicesManager.hasRights(self, self._tabPlugins)

        if not hasRights:
            RHConferenceModifBase._checkProtection(self)
Example #29
0
 def _checkProtection(self):
     if not PluginsHolder().hasPluginType("Collaboration"):
         raise PluginError("Collaboration plugin system is not active")
     
     hasRights = RCCollaborationAdmin.hasRights(self, None) or \
                 RCCollaborationPluginAdmin.hasRights(self, None, self._tabPlugins) or \
                 RCVideoServicesManager.hasRights(self, self._tabPlugins)
     
     if not hasRights:
         RHConferenceModifBase._checkProtection(self)
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     self._params = params
     self._params['loading_gif'] = '{}/images/loading.gif'.format(
         Config.getInstance().getBaseURL())
     self._params['report'] = ReportGeneral.get(
         event_id=params.get('confId'),
         contrib_id=params.get('contrib_id'),
         start_date=params.get('start_date'),
         end_date=params.get('end_date'))
Example #31
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     self._params = params
     self._params["loading_gif"] = "{}/images/loading.gif".format(Config.getInstance().getBaseURL())
     self._params["report"] = ReportGeneral.get(
         event_id=params.get("confId"),
         contrib_id=params.get("contrib_id"),
         start_date=params.get("start_date"),
         end_date=params.get("end_date"),
     )
Example #32
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     if 'fileId' not in params:
         raise NotFoundError(_("Missing 'fileId' argument."))
     self._offlineEvent = ModuleHolder().getById(
         "offlineEvents").getOfflineEventByFileId(params["confId"],
                                                  params["fileId"])
     if not self._offlineEvent or not self._offlineEvent.file or \
        not os.path.isfile(self._offlineEvent.file.getFilePath()):
         raise NotFoundError(
             _("The file you tried to access does not exist anymore."))
Example #33
0
    def _checkParams(self, params):
        RHConferenceModifBase._checkParams(self, params)

        self._activeTabName = params.get("tab", None)

        self._tabs = []
        #fill the tabs with the active plugins in the Instant Messaging module
        for plugin in PluginsHolder().getPluginType(
                'InstantMessaging').getPluginList():
            if plugin.isActive():
                self._tabs.append(plugin.getName())
Example #34
0
    def _checkParams(self, params):
        RHConferenceModifBase._checkParams(self, params)
        self.spkUniqueId = params.get('spkUniqueId', None)
        self.file = params.get('file', None)
        self.filePath = ''

        if self.file and self.spkUniqueId:
            try:
                self.filePath = self.saveFileToTemp(self.file.file)
                self._tempFilesToDelete.append(self.filePath)
            except AttributeError:
                raise MaKaCError("Problem when storing file")
Example #35
0
 def _checkProtection(self):
     self.protection_overridden = False
     if hasattr(self, 'definition'):
         # check if user can manage *that* request
         can_manage_request = session.user and self.definition and self.definition.can_be_managed(session.user)
     else:
         # check if user can manage any request
         can_manage_request = session.user and is_request_manager(session.user)
     can_manage_event = self.event_new.can_manage(session.user, allow_key=True)
     self.protection_overridden = can_manage_request and not can_manage_event
     if not can_manage_request and not can_manage_event:
         RHConferenceModifBase._checkProtection(self)
Example #36
0
    def _checkParams(self, params):
        RHConferenceModifBase._checkParams(self, params)
        self.spkUniqueId = params.get('spkUniqueId', None)
        self.file = params.get('file', None)
        self.filePath = ''

        if self.file and self.spkUniqueId:
            try:
                self.filePath = self.saveFileToTemp(self.file.file)
                self._tempFilesToDelete.append(self.filePath)
            except AttributeError:
                raise MaKaCError("Problem when storing file")
Example #37
0
 def _checkProtection(self):
     self.protection_overridden = False
     if hasattr(self, 'definition'):
         # check if user can manage *that* request
         can_manage_request = session.user and self.definition.can_be_managed(session.user)
     else:
         # check if user can manage any request
         can_manage_request = session.user and is_request_manager(session.user)
     can_manage_event = self._conf.canModify(self.getAW())
     self.protection_overridden = can_manage_request and not can_manage_event
     if not can_manage_request and not can_manage_event:
         RHConferenceModifBase._checkProtection(self)
Example #38
0
 def _checkProtection(self):
     self.protection_overridden = False
     if hasattr(self, 'definition'):
         # check if user can manage *that* request
         can_manage_request = session.avatar and self.definition.can_be_managed(
             session.avatar)
     else:
         # check if user can manage any request
         can_manage_request = session.avatar and is_request_manager(
             session.avatar)
     can_manage_event = self._conf.canModify(self.getAW())
     self.protection_overridden = can_manage_request and not can_manage_event
     if not can_manage_request and not can_manage_event:
         RHConferenceModifBase._checkProtection(self)
Example #39
0
 def _checkProtection(self):
     if not self.session or self.session_management_level == SessionManagementLevel.none:
         RHConferenceModifBase._checkProtection(self)
     else:
         if self.session_management_level == SessionManagementLevel.manage:
             func = lambda u: self.session.can_manage(u)
         elif self.session_management_level == SessionManagementLevel.coordinate_with_blocks:
             func = lambda u: self.session.can_manage_blocks(u)
         elif self.session_management_level == SessionManagementLevel.coordinate_with_contribs:
             func = lambda u: self.session.can_manage_contributions(u)
         elif self.session_management_level == SessionManagementLevel.coordinate:
             func = lambda u: self.session.can_manage(u, role='coordinate')
         else:
             raise Exception("Invalid session management level")
         if not func(session.user):
             raise Forbidden
Example #40
0
 def _checkProtection(self):
     if not self.session or self.session_management_level == SessionManagementLevel.none:
         RHConferenceModifBase._checkProtection(self)
     else:
         if self.session_management_level == SessionManagementLevel.manage:
             func = lambda u: self.session.can_manage(u)
         elif self.session_management_level == SessionManagementLevel.coordinate_with_blocks:
             func = lambda u: self.session.can_manage_blocks(u)
         elif self.session_management_level == SessionManagementLevel.coordinate_with_contribs:
             func = lambda u: self.session.can_manage_contributions(u)
         elif self.session_management_level == SessionManagementLevel.coordinate:
             func = lambda u: self.session.can_manage(u, role='coordinate')
         else:
             raise Exception("Invalid session management level")
         if not func(session.user):
             raise Forbidden
Example #41
0
    def _checkParams(self, params):
        RHConferenceModifBase._checkParams(self, params)

        self._activeTabName = params.get("tab", None)

        self._canSeeAllPluginTabs = self._target.canModify(
            self.getAW()) or RCCollaborationAdmin.hasRights(
                self) or RCVideoServicesManager.hasRights(self)

        # we build the list 'allowedTabs', a list of all tabs that the user can see
        if self._canSeeAllPluginTabs:
            #if the logged in user is event manager, server admin or collaboration admin: we show all plugin tabs
            allowedTabs = CollaborationTools.getTabs(self._conf)
        else:
            #else we show only the tabs of plugins of which the user is admin
            allowedTabs = CollaborationTools.getTabs(self._conf,
                                                     self._getUser())

        if self._target.canModify(
                self.getAW()) or RCVideoServicesManager.hasRights(self):
            allowedTabs.append('Managers')

        # we order the list of allowedTabs into the self._tabs list
        tabOrder = CollaborationTools.getCollaborationOptionValue('tabOrder')
        self._tabs = []

        for tabName in tabOrder:
            if tabName in allowedTabs:
                self._tabs.append(tabName)
                allowedTabs.remove(tabName)

        for tabName in allowedTabs:
            if tabName != 'Managers':
                self._tabs.append(tabName)

        if 'Managers' in allowedTabs:
            self._tabs.append('Managers')
 def _checkProtection(self):
     if not RCPaperReviewManager.hasRights(self):
         RHConferenceModifBase._checkProtection(self)
 def _checkParams( self, params ):
     RHConferenceModifBase._checkParams( self, params )
Example #44
0
 def _checkProtection(self):
     if not PluginsHolder().hasPluginType("Collaboration"):
         raise PluginError("Collaboration plugin system is not active")
     if not RCVideoServicesManager.hasRights(self):
         RHConferenceModifBase._checkProtection(self)
Example #45
0
 def _checkProtection(self):
     self._allowClosed = can_lock(self._conf, session.user)
     RHConferenceModifBase._checkProtection(self)
Example #46
0
 def _checkProtection(self):
     RHConferenceModifBase._checkProtection(self)
     RHRoomBookingBase._checkProtection(self)
 def _checkProtection(self):
     if self._target.hasEnabledSection("paperReviewing"):
         if not RCPaperReviewManager.hasRights(self) and not RCReferee.hasRights(self):
             RHConferenceModifBase._checkProtection(self);
     else:
         raise MaKaCError(_("Paper Reviewing is not active for this conference"))
Example #48
0
 def _checkProtection(self):
     RHConferenceModifBase._checkProtection(self)
     if not can_lock(self.event_new, session.user):
         raise Forbidden
Example #49
0
 def _checkProtection(self):
     self._allowClosed = can_lock(self.event_new, session.user)
     RHConferenceModifBase._checkProtection(self)
Example #50
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     self.target_category = Category.get_one(int(request.form['target_category_id']), is_deleted=False)
     if not self.target_category.can_create_events(session.user):
         raise Forbidden(_("You may only move events to categories where you are allowed to create events."))
Example #51
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     self.obj = get_object_from_args()[2]
     if self.obj is None:
         raise NotFound
Example #52
0
 def _checkParams(self, params):
     self._doNotSanitizeFields.append('from_address')
     RHConferenceModifBase._checkParams(self, params)
Example #53
0
 def _checkProtection(self):
     if self._target.hasEnabledSection("paperReviewing"):
         RHConferenceModifBase._checkProtection(self)
     else:
         raise MaKaCError(_("Paper Reviewing is not active for this conference"))
Example #54
0
 def _checkProtection(self):
     RHConferenceModifBase._checkProtection(self)
     if not can_lock(self._conf, session.user):
         raise Forbidden
Example #55
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     try:
         self.plugin = get_payment_plugins()[request.view_args['method']]
     except KeyError:
         raise NotFound
Example #56
0
 def _checkProtection(self):
     if not PluginsHolder().hasPluginType("Collaboration"):
         raise PluginError("Collaboration plugin system is not active")
     if not RCVideoServicesManager.hasRights(self):
         RHConferenceModifBase._checkProtection(self)
Example #57
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     self.event = self._conf
Example #58
0
 def _checkParams(self, params):
     RHConferenceModifBase._checkParams(self, params)
     self.event = self._conf