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)
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)
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__))
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__) )