コード例 #1
0
ファイル: services.py プロジェクト: Ictp/indico
    def _checkCanManagePlugin(self, plugin):
        isAdminOnlyPlugin = CollaborationTools.isAdminOnlyPlugin(plugin)

        hasAdminRights = RCCollaborationAdmin.hasRights(self._getUser()) or RCCollaborationPluginAdmin.hasRights(self._getUser(), [plugin])

        if not hasAdminRights and isAdminOnlyPlugin:
            raise CollaborationException(_("Cannot acces service of admin-only plugin if user is not admin, for event: ") + str(self._conf.getId()) + _(" with the service ") + str(self.__class__) )

        elif not hasAdminRights and not RCVideoServicesManager.hasRights(self._getUser(), self._conf, [plugin]):
            #we check if it's an event creator / manager (this will call ConferenceModifBase._checkProtection)
            ConferenceModifBase._checkProtection(self)
コード例 #2
0
    def _checkCanManagePlugin(self, plugin):
        isAdminOnlyPlugin = CollaborationTools.isAdminOnlyPlugin(plugin)

        hasAdminRights = RCCollaborationAdmin.hasRights(self) or \
                         RCCollaborationPluginAdmin.hasRights(self, None, [plugin])

        if not hasAdminRights and isAdminOnlyPlugin:
            raise CollaborationException(
                _("Cannot acces service of admin-only plugin if user is not admin, for event: "
                  ) + str(self._conf.getId()) + _(" with the service ") +
                str(self.__class__))

        elif not hasAdminRights and not RCVideoServicesManager.hasRights(
                self, [plugin]):
            #we check if it's an event creator / manager (this will call ConferenceModifBase._checkProtection)
            CollaborationBase._checkProtection(self)
コード例 #3
0
    def _checkParams(self):
        CollaborationBase._checkParams(self)
        if self._params.has_key('plugin'):
            self._plugin = self._params['plugin']
        else:
            raise CollaborationException(
                _("Plugin name not set when trying to add or remove a manager on event: "
                  ) + str(self._conf.getId()) + _(" with the service ") +
                str(self.__class__))

        if CollaborationTools.getCollaborationPluginType().hasPlugin(
                self._plugin) and CollaborationTools.isAdminOnlyPlugin(
                    self._plugin):
            raise CollaborationException(
                _("Tried to add or remove a manager for an admin-only plugin on event : "
                  ) + str(self._conf.getId()) + _(" with the service ") +
                str(self.__class__))
コード例 #4
0
ファイル: services.py プロジェクト: jbenito3/indico
    def _checkParams(self):
        CollaborationBase._checkParams(self)
        if self._params.has_key("plugin"):
            self._plugin = self._params["plugin"]
        else:
            raise CollaborationException(
                _("Plugin name not set when trying to add or remove a manager on event: ")
                + str(self._conf.getId())
                + _(" with the service ")
                + str(self.__class__)
            )

        if CollaborationTools.getCollaborationPluginType().hasPlugin(
            self._plugin
        ) and CollaborationTools.isAdminOnlyPlugin(self._plugin):
            raise CollaborationException(
                _("Tried to add or remove a manager for an admin-only plugin on event : ")
                + str(self._conf.getId())
                + _(" with the service ")
                + str(self.__class__)
            )