当前位置: 首页>>代码示例>>Python>>正文


Python handlers.RCCollaborationAdmin类代码示例

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


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

示例1: getVars

    def getVars(self):
        from MaKaC.plugins.Collaboration.handlers import RCCollaborationAdmin
        from MaKaC.webinterface.rh.admins import RCAdmin

        vars = wcomponents.WTemplated.getVars(self)
        user = ContextManager.get("currentUser")
        vars["user"] = user
        vars["IsAdmin"] = RCAdmin.hasRights(self._rh)
        vars["IsCollaborationAdmin"] = RCCollaborationAdmin.hasRights(user)
        return vars
开发者ID:marksteward,项目名称:indico,代码行数:10,代码来源:pages.py

示例2: _checkCanManagePlugin

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

示例3: 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 = Catalog.getIdx("cs_bookingmanager_conference").get(conference.getId())

        from MaKaC.plugins.Collaboration.handlers import RCCollaborationAdmin
        isAdminUser = RCCollaborationAdmin.hasRights(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:iason-andr,项目名称:indico,代码行数:21,代码来源:collaborationTools.py

示例4: _checkProtection

 def _checkProtection(self):
     if not RCCollaborationAdmin.hasRights(self._getUser()):
         AdminService._checkProtection(self)
开发者ID:Ictp,项目名称:indico,代码行数:3,代码来源:services.py

示例5: addParamsToHeaderItem

 def addParamsToHeaderItem(self, obj, params, itemList):
     user = params.get("user", None)
     if user:
         if (user.isAdmin() or RCCollaborationAdmin.hasRights(user) or RCCollaborationPluginAdmin.hasRights(user, plugins="any")) and CollaborationTools.anyPluginsAreActive():
             itemList.append({'id': 'vsOverview', 'url': UHAdminCollaboration.getURL(), 'text': _("Video Services Overview")})
开发者ID:Json-Andriopoulos,项目名称:indico,代码行数:5,代码来源:components.py

示例6: isPluginTypeAdmin

 def isPluginTypeAdmin(self, obj, params={}):
     """ Returns True if the user is a Server Admin or a Collaboration admin
         user: an Avatar object
     """
     return RCCollaborationAdmin.hasRights(params.get("user", None))
开发者ID:Json-Andriopoulos,项目名称:indico,代码行数:5,代码来源:components.py

示例7: isAllowedToAccess

 def isAllowedToAccess(self, obj, params):
     user = params["user"]
     return Catalog.getIdx("cs_bookingmanager_conference").get(params["conf"].getId()).isPluginManagerOfAnyPlugin(user) or \
         RCCollaborationAdmin.hasRights(user=user) or RCCollaborationPluginAdmin.hasRights(user=user, plugins ='any')
开发者ID:Json-Andriopoulos,项目名称:indico,代码行数:4,代码来源:components.py

示例8: fillManagementSideMenu

 def fillManagementSideMenu(cls, obj, params={}):
     csbm = Catalog.getIdx("cs_bookingmanager_conference").get(obj._conf.getConference().getId())
     if csbm is not None and csbm.isCSAllowed(obj._rh.getAW().getUser()) and \
         (obj._conf.canModify(obj._rh.getAW()) or RCVideoServicesManager.hasRights(obj._rh._getUser(), obj._conf, 'any') or
             RCCollaborationAdmin.hasRights(obj._rh._getUser()) or RCCollaborationPluginAdmin.hasRights(obj._rh._getUser(), plugins='any')):
         params['Video Services'] = wcomponents.SideMenuItem(_("Video Services"), UHConfModifCollaboration.getURL(obj._conf, secure=obj._rh.use_https()))
开发者ID:Json-Andriopoulos,项目名称:indico,代码行数:6,代码来源:components.py

示例9: 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 = Catalog.getIdx("cs_bookingmanager_conference").get(self._conf.getId())
        user = self._rh._getUser()
        isManager = user.isAdmin() or RCCollaborationAdmin.hasRights(user) or \
            RCCollaborationPluginAdmin.hasRights(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:ferhatelmas,项目名称:indico,代码行数:61,代码来源:pages.py

示例10: _hasAccess

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


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