• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python collaboration.RCCollaborationAdmin类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中MaKaC.webinterface.rh.collaboration.RCCollaborationAdmin的典型用法代码示例。如果您正苦于以下问题:Python RCCollaborationAdmin类的具体用法?Python RCCollaborationAdmin怎么用?Python RCCollaborationAdmin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了RCCollaborationAdmin类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: _checkProtection

    def _checkProtection(self):
        from MaKaC.webinterface.rh.collaboration import RCCollaborationAdmin, RCCollaborationPluginAdmin

        if not RCCollaborationAdmin.hasRights(self, None) and not RCCollaborationPluginAdmin.hasRights(
            self, plugins="any"
        ):
            base.RHDisplayBaseProtected._checkProtection(self)
开发者ID:jt1,项目名称:indico,代码行数:7,代码来源:categoryDisplay.py


示例2: getVars

    def getVars(self):
        vars = WCSPageTemplateBase.getVars( self )

        vars["IsSingleBooking"] = not CollaborationTools.getCSBookingClass(self._pluginId)._allowMultiple
        vars["Conference"] = self._conf

        isLecture = self._conf.getType() == 'simple_event'
        vars["IsLecture"] = isLecture

        underTheLimit = self._conf.getNumberOfContributions() <= self._RecordingRequestOptions["contributionLoadLimit"].getValue()
        manager = self._conf.getCSBookingManager()
        user = self._rh._getUser()
        isManager = user.isAdmin() or RCCollaborationAdmin.hasRights(user=user) or RCCollaborationPluginAdmin.hasRights(user=user, plugins=['RecordingRequest'])
        booking = manager.getSingleBooking('RecordingRequest')
        initialChoose = booking is not None and booking._bookingParams['talks'] == 'choose'
        initialDisplay = (self._conf.getNumberOfContributions() > 0 and underTheLimit) or (booking is not None and initialChoose)


        vars["InitialChoose"] = initialChoose
        vars["DisplayTalks"] = initialDisplay
        vars["isManager"] = isManager

        talks, rRoomFullNames, rRoomNames, recordingAbleTalks, recordingUnableTalks = getCommonTalkInformation(self._conf)
        nRecordingCapable = len(recordingAbleTalks)

        vars["HasRecordingCapableTalks"] = nRecordingCapable > 0
        vars["NTalks"] = len(talks)

        # list of "locationName:roomName" strings
        vars["RecordingCapableRooms"] = rRoomFullNames
        vars["NRecordingCapableContributions"] = nRecordingCapable

        # we check if the event itself is recoring capable (depends on event's room)
        confLocation = self._conf.getLocation()
        confRoom = self._conf.getRoom()
        if confLocation and confRoom and (confLocation.getName() + ":" + confRoom.getName() in rRoomNames):
            topLevelRecordingCapable = True
        else:
            topLevelRecordingCapable = False

        # Finally, this event is recoring capable if the event itself
        # or one of its talks are capable or user is admin, collaboration
        # manager or recording plugin manager
        vars["RecordingCapable"] = topLevelRecordingCapable or nRecordingCapable > 0 or isManager

        recordingAbleTalks.sort(key = Contribution.contributionStartDateForSort)
        talks.sort(key = Contribution.contributionStartDateForSort)

        fossil_args = dict(tz=self._conf.getTimezone(),
                           units='(hours)_minutes',
                           truncate=True)

        vars["Contributions"] = fossilize(talks, IContributionRRFossil, **fossil_args)
        vars["ContributionsAble"] = fossilize(recordingAbleTalks, IContributionRRFossil, **fossil_args)
        vars["ContributionsUnable"] = fossilize(recordingUnableTalks, IContributionRRFossil, **fossil_args)

        vars["PostingUrgency"] = postingUrgency
        vars["linkToEA"] = collaborationUrlHandlers.UHCollaborationElectronicAgreement.getURL(self._conf)
        vars["agreementName"] = CollaborationTools.getOptionValue("RecordingRequest", "AgreementName")
        return vars
开发者ID:VishrutMehta,项目名称:indico,代码行数:60,代码来源:pages.py


示例3: getVars

 def getVars( self ):
     vars = wcomponents.WTemplated.getVars( self )
     
     plugins = self._tabPlugins
     singleBookingPlugins, multipleBookingPlugins = CollaborationTools.splitPluginsByAllowMultiple(plugins)
     CSBookingManager = self._conf.getCSBookingManager()
     
     bookingsS = {}
     for p in singleBookingPlugins:
         bookingList = CSBookingManager.getBookingList(filterByType = p.getName())
         if len(bookingList) > 0:
             bookingsS[p.getName()] = DictPickler.pickle(bookingList[0])
             
     bookingsM = DictPickler.pickle(CSBookingManager.getBookingList(
         sorted = True,
         notify = True,
         filterByType = [p.getName() for p in multipleBookingPlugins]))
     
     vars["Conference"] = self._conf
     vars["AllPlugins"] = plugins
     vars["SingleBookingPlugins"] = singleBookingPlugins
     vars["BookingsS"] = bookingsS
     vars["MultipleBookingPlugins"] = multipleBookingPlugins
     vars["BookingsM"] = bookingsM
     vars["Tab"] = self._activeTab
     vars["EventDate"] = formatDateTime(getAdjustedDate(nowutc(),self._conf))
     
     from MaKaC.webinterface.rh.collaboration import RCCollaborationAdmin, RCCollaborationPluginAdmin
     vars["UserIsAdmin"] = RCCollaborationAdmin.hasRights(user = self._user) or RCCollaborationPluginAdmin.hasRights(user = self._user, plugins = self._tabPlugins)
     
     singleBookingForms = {}
     multipleBookingForms = {}
     JSCodes = {}
     canBeNotified = {}
     
     for plugin in singleBookingPlugins:
         pluginName = plugin.getName()
         templateClass = CollaborationTools.getTemplateClass(pluginName, "WNewBookingForm")
         singleBookingForms[pluginName] = templateClass(self._conf, pluginName, self._user).getHTML()
         
     for plugin in multipleBookingPlugins:
         pluginName = plugin.getName()
         templateClass = CollaborationTools.getTemplateClass(pluginName, "WNewBookingForm")
         multipleBookingForms[pluginName] = templateClass(self._conf, pluginName, self._user).getHTML()
     
     for plugin in plugins:
         pluginName = plugin.getName()
         
         templateClass = CollaborationTools.getTemplateClass(pluginName, "WMain")
         JSCodes[pluginName] = templateClass(pluginName, self._conf).getHTML()
         
         bookingClass = CollaborationTools.getCSBookingClass(pluginName)
         canBeNotified[pluginName] = bookingClass._canBeNotifiedOfEventDateChanges
         
     vars["SingleBookingForms"] = singleBookingForms    
     vars["MultipleBookingForms"] = multipleBookingForms
     vars["JSCodes"] = JSCodes
     vars["CanBeNotified"] = canBeNotified
     
     return vars
开发者ID:lukasnellen,项目名称:indico,代码行数:60,代码来源:collaboration.py


示例4: getVars

 def getVars(self):
     vars = wcomponents.WTemplated.getVars(self)
     
     vars["HasCollaboration"] = PluginsHolder().hasPluginType("Collaboration")
     vars["IsAdmin"] = RCAdmin.hasRights(self._rh)
     vars["IsCollaborationAdmin"] = RCCollaborationAdmin.hasRights(self._rh)
     
     return vars
开发者ID:lukasnellen,项目名称:indico,代码行数:8,代码来源:help.py


示例5: _checkProtection

    def _checkProtection(self):
        hasRights = (
            RCCollaborationAdmin.hasRights(self)
            or RCCollaborationPluginAdmin.hasRights(self, None, [self._bookingPlugin])
            or RCVideoServicesManager.hasRights(self, [self._bookingPlugin])
        )

        if not hasRights:
            CollaborationBase._checkProtection(self)
开发者ID:lukasnellen,项目名称:indico,代码行数:9,代码来源:collaboration.py


示例6: _checkCanManagePlugin

    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)
开发者ID:bubbas,项目名称:indico,代码行数:12,代码来源:collaboration.py


示例7: getVars

    def getVars(self):
        vars = wcomponents.WTemplated.getVars(self)
        vars["HasCollaboration"] = PluginsHolder().hasPluginType("Collaboration")
        vars["HasImporter"] = PluginsHolder().hasPluginType("importer")
        vars["HasChat"] = PluginsHolder().hasPluginType("InstantMessaging")
        vars["IsAdmin"] = RCAdmin.hasRights(self._rh)
        if PluginsHolder().hasPluginType("Collaboration"):
            from MaKaC.webinterface.rh.collaboration import RCCollaborationAdmin
            vars["IsCollaborationAdmin"] = RCCollaborationAdmin.hasRights(self._rh)
        else:
            vars["IsCollaborationAdmin"] = False

        return vars
开发者ID:bubbas,项目名称:indico,代码行数:13,代码来源:help.py


示例8: canUserManagePlugin

    def canUserManagePlugin(cls, conference, plugin, user):
        """ Utility function that returns if a user can interact with a plugin inside an event,
            depending on the plugin, the user, and the event where the user tries to see a plugin page
            or change a plugin object
        """
        csbm = conference.getCSBookingManager()

        from MaKaC.webinterface.rh.collaboration import RCCollaborationAdmin
        isAdminUser = RCCollaborationAdmin.hasRights(user = user)

        isAdminOnlyPlugin = cls.isAdminOnlyPlugin(plugin)

        canSee = (
                isAdminUser or
                user in plugin.getOption('admins').getValue() or
                not isAdminOnlyPlugin and (conference.canUserModify(user) or
                                           csbm.isVideoServicesManager(user) or
                                           csbm.isPluginManager(plugin.getName(), user) ) )

        return canSee
开发者ID:aninhalacerda,项目名称:indico,代码行数:20,代码来源:collaborationTools.py


示例9: getVars

    def getVars(self):
        vars = WCSPageTemplateBase.getVars(self)

        vars["Conference"] = self._conf
        vars["IsSingleBooking"] = not CollaborationTools.getCSBookingClass(self._pluginId)._allowMultiple

        isLecture = self._conf.getType() == "simple_event"
        vars["IsLecture"] = isLecture

        underTheLimit = (
            self._conf.getNumberOfContributions() <= self._WebcastRequestOptions["contributionLoadLimit"].getValue()
        )
        manager = self._conf.getCSBookingManager()
        user = self._rh._getUser()
        isManager = (
            user.isAdmin()
            or RCCollaborationAdmin.hasRights(user=user)
            or RCCollaborationPluginAdmin.hasRights(user=user, plugins=["WebcastRequest"])
        )
        booking = manager.getSingleBooking("WebcastRequest")
        initialChoose = booking is not None and booking._bookingParams["talks"] == "choose"
        initialDisplay = (self._conf.getNumberOfContributions() > 0 and underTheLimit) or (
            booking is not None and initialChoose
        )

        vars["DisplayTalks"] = initialDisplay
        vars["InitialChoose"] = initialChoose
        vars["isManager"] = isManager

        talks, wcRoomFullNames, wcRoomNames, webcastAbleTalks, webcastUnableTalks = getCommonTalkInformation(self._conf)
        nWebcastCapable = len(webcastAbleTalks)

        vars["HasWebcastCapableTalks"] = nWebcastCapable > 0
        vars["NTalks"] = len(talks)

        # list of "locationName:roomName" strings
        vars["WebcastCapableRooms"] = wcRoomFullNames
        vars["NWebcastCapableContributions"] = nWebcastCapable

        # we see if the event itself is webcast capable (depends on event's room)
        confLocation = self._conf.getLocation()
        confRoom = self._conf.getRoom()
        if confLocation and confRoom and (confLocation.getName() + ":" + confRoom.getName() in wcRoomNames):
            topLevelWebcastCapable = True
        else:
            topLevelWebcastCapable = False

        # Finally, this event is webcast capable if the event itself or
        # or one of its talks are capable or user is admin, collaboration
        # manager or webcast plugin manager
        vars["WebcastCapable"] = topLevelWebcastCapable or nWebcastCapable > 0 or isManager

        if initialDisplay:
            webcastAbleTalks.sort(key=Contribution.contributionStartDateForSort)

            fossil_args = dict(tz=self._conf.getTimezone(), units="(hours)_minutes", truncate=True)

            vars["Contributions"] = fossilize(talks, IContributionWRFossil, **fossil_args)
            vars["ContributionsAble"] = fossilize(webcastAbleTalks, IContributionWRFossil, **fossil_args)
            vars["ContributionsUnable"] = fossilize(webcastUnableTalks, IContributionWRFossil, **fossil_args)
        else:
            vars["Contributions"] = []
            vars["ContributionsAble"] = []
            vars["ContributionsUnable"] = []

        vars["Audiences"] = CollaborationTools.getOptionValue("WebcastRequest", "webcastAudiences")
        vars["linkToEA"] = collaborationUrlHandlers.UHCollaborationElectronicAgreement.getURL(self._conf)
        vars["agreementName"] = CollaborationTools.getOptionValue("WebcastRequest", "AgreementName")
        return vars
开发者ID:arturodr,项目名称:indico,代码行数:69,代码来源:pages.py


示例10: _hasAccess

 def _hasAccess(self, aw):
     return RCCollaborationAdmin.hasRights(user=aw.getUser())
开发者ID:pedrogaudencio,项目名称:indico,代码行数:2,代码来源:http_api.py


示例11: getVars

    def getVars(self):
        vars = wcomponents.WTemplated.getVars(self)

        plugins = self._tabPlugins
        singleBookingPlugins, multipleBookingPlugins = CollaborationTools.splitPluginsByAllowMultiple(plugins)
        csBookingManager = self._conf.getCSBookingManager()

        bookingsS = {}

        for p in singleBookingPlugins:
            bookingList = csBookingManager.getBookingList(filterByType = p.getId())
            if len(bookingList) > 0:
                bookingsS[p.getId()] = fossilize(bookingList[0]) #will use ICSBookingConfModifBaseFossil or inheriting fossil

        bookingsM = fossilize(csBookingManager.getBookingList(
            sorted = True,
            notify = True,
            filterByType = [p.getName() for p in multipleBookingPlugins])) #will use ICSBookingConfModifBaseFossil or inheriting fossil

        vars["Conference"] = self._conf
        vars["AllPlugins"] = plugins
        vars["SingleBookingPlugins"] = singleBookingPlugins
        vars["BookingsS"] = bookingsS
        vars["MultipleBookingPlugins"] = multipleBookingPlugins
        vars["BookingsM"] = bookingsM
        vars["Tab"] = self._activeTab
        vars["EventDate"] = formatDateTime(getAdjustedDate(nowutc(), self._conf))

        from MaKaC.webinterface.rh.collaboration import RCCollaborationAdmin, RCCollaborationPluginAdmin, RCVideoServicesUser
        vars["UserIsAdmin"] = RCCollaborationAdmin.hasRights(user = self._user) or RCCollaborationPluginAdmin.hasRights(user = self._user, plugins = self._tabPlugins)

        hasCreatePermissions = {}
        videoServSupport = {}
        for plugin in plugins:
            pname = plugin.getName()
            hasCreatePermissions[pname] = RCVideoServicesUser.hasRights(user = self._user, pluginName = pname)
            videoServSupport[pname] = plugin.getOption("contactSupport").getValue() if plugin.hasOption("contactSupport") else ""
        vars["HasCreatePermissions"] = hasCreatePermissions
        vars["VideoServiceSupport"] = videoServSupport




        singleBookingForms = {}
        multipleBookingForms = {}
        jsCodes = {}
        canBeNotified = {}

        for plugin in singleBookingPlugins:
            pluginId = plugin.getId()
            templateClass = CollaborationTools.getTemplateClass(pluginId, "WNewBookingForm")
            singleBookingForms[pluginId] = templateClass(self._conf, plugin.getId(), self._user).getHTML()

        for plugin in multipleBookingPlugins:
            pluginId = plugin.getId()
            templateClass = CollaborationTools.getTemplateClass(pluginId, "WNewBookingForm")
            newBookingFormHTML = templateClass(self._conf, plugin.getId(), self._user).getHTML()

            advancedTabClass = CollaborationTools.getTemplateClass(pluginId, "WAdvancedTab")
            if advancedTabClass:
                advancedTabClassHTML = advancedTabClass(self._conf, plugin.getId(), self._user).getHTML()
            else:
                advancedTabClassHTML = WConfModifCollaborationDefaultAdvancedTab(self._conf, plugin, self._user).getHTML()
            multipleBookingForms[pluginId] = (newBookingFormHTML, advancedTabClassHTML)

        for plugin in plugins:
            pluginId = plugin.getId()

            templateClass = CollaborationTools.getTemplateClass(pluginId, "WMain")
            jsCodes[pluginId] = templateClass(self._conf, plugin.getId(), self._user).getHTML()

            bookingClass = CollaborationTools.getCSBookingClass(pluginId)
            canBeNotified[pluginId] = bookingClass._canBeNotifiedOfEventDateChanges

        vars["SingleBookingForms"] = singleBookingForms
        vars["MultipleBookingForms"] = multipleBookingForms
        vars["JSCodes"] = jsCodes
        vars["CanBeNotified"] = canBeNotified

        return vars
开发者ID:arturodr,项目名称:indico,代码行数:80,代码来源:collaboration.py


示例12: _checkProtection

 def _checkProtection(self):
     if not RCCollaborationAdmin.hasRights(self) and not RCCollaborationPluginAdmin.hasRights(self, None, [self._bookingPlugin]):
         raise CollaborationException(_("You don't have the rights to perform this operation on this booking"))
开发者ID:bubbas,项目名称:indico,代码行数:3,代码来源:collaboration.py



注:本文中的MaKaC.webinterface.rh.collaboration.RCCollaborationAdmin类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python conferenceBase.RHConferenceBase类代码示例发布时间:2022-05-24
下一篇:
Python base.RHProtected类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap