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


Python ICheckinCheckoutPolicy.getBaseline方法代码示例

本文整理汇总了Python中plone.app.iterate.interfaces.ICheckinCheckoutPolicy.getBaseline方法的典型用法代码示例。如果您正苦于以下问题:Python ICheckinCheckoutPolicy.getBaseline方法的具体用法?Python ICheckinCheckoutPolicy.getBaseline怎么用?Python ICheckinCheckoutPolicy.getBaseline使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在plone.app.iterate.interfaces.ICheckinCheckoutPolicy的用法示例。


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

示例1: checkin_allowed

# 需要导入模块: from plone.app.iterate.interfaces import ICheckinCheckoutPolicy [as 别名]
# 或者: from plone.app.iterate.interfaces.ICheckinCheckoutPolicy import getBaseline [as 别名]
    def checkin_allowed(self):
        """Check if a checkin is allowed
        """
        context = aq_inner(self.context)
        checkPermission = getSecurityManager().checkPermission

        if not interfaces.IIterateAware.providedBy(context):
            return False

        archiver = interfaces.IObjectArchiver(context)
        if not archiver.isVersionable():
            return False

        if not IWorkingCopy.providedBy(context):
            return False

        policy = ICheckinCheckoutPolicy(context, None)
        if policy is None:
            return False

        original = policy.getBaseline()
        if original is None:
            return False

        can_modify = checkPermission(
            Products.CMFCore.permissions.ModifyPortalContent,
            original,
        )
        if not can_modify:
            return False

        return True
开发者ID:plone,项目名称:plone.app.iterate,代码行数:34,代码来源:control.py

示例2: get_baseline_state

# 需要导入模块: from plone.app.iterate.interfaces import ICheckinCheckoutPolicy [as 别名]
# 或者: from plone.app.iterate.interfaces.ICheckinCheckoutPolicy import getBaseline [as 别名]
    def get_baseline_state(self):
        policy = ICheckinCheckoutPolicy(self.context)
        baseline = policy.getBaseline()
        if baseline is None:
            baseline = self.context

        return get_state(baseline)
开发者ID:eea,项目名称:eea.climateadapt.plone,代码行数:9,代码来源:viewlets.py

示例3: cancel_allowed

# 需要导入模块: from plone.app.iterate.interfaces import ICheckinCheckoutPolicy [as 别名]
# 或者: from plone.app.iterate.interfaces.ICheckinCheckoutPolicy import getBaseline [as 别名]
 def cancel_allowed(self):
     """Check to see if the user can cancel the checkout on the
     given working copy
     """
     policy = ICheckinCheckoutPolicy(self.context, None)
     if policy is None:
         return False
     original = policy.getBaseline()
     return original is not None
开发者ID:plone,项目名称:plone.app.iterate,代码行数:11,代码来源:control.py

示例4: __call__

# 需要导入模块: from plone.app.iterate.interfaces import ICheckinCheckoutPolicy [as 别名]
# 或者: from plone.app.iterate.interfaces.ICheckinCheckoutPolicy import getBaseline [as 别名]
 def __call__(self):
     policy = ICheckinCheckoutPolicy(self.context)
     if IBaseline.providedBy(self.context):
         self.baseline = self.context
         self.working_copy = policy.getWorkingCopy()
     elif IWorkingCopy.providedBy(self.context):
         self.working_copy = self.context
         self.baseline = policy.getBaseline()
     else:
         raise AttributeError('Invalid Context')
     return self.index()
开发者ID:plone,项目名称:plone.app.iterate,代码行数:13,代码来源:diff.py

示例5: checkout_allowed

# 需要导入模块: from plone.app.iterate.interfaces import ICheckinCheckoutPolicy [as 别名]
# 或者: from plone.app.iterate.interfaces.ICheckinCheckoutPolicy import getBaseline [as 别名]
    def checkout_allowed(self):
        """Check if a checkout is allowed.
        """
        context = aq_inner(self.context)

        if not interfaces.IIterateAware.providedBy(context):
            return False

        archiver = interfaces.IObjectArchiver(context)
        if not archiver.isVersionable():
            return False

        policy = ICheckinCheckoutPolicy(context, None)
        if policy is None:
            return False

        if policy.getWorkingCopy() is not None:
            return False

        # check if its is a checkout
        if policy.getBaseline() is not None:
            return False

        return True
开发者ID:plone,项目名称:plone.app.iterate,代码行数:26,代码来源:control.py

示例6: handle_check

# 需要导入模块: from plone.app.iterate.interfaces import ICheckinCheckoutPolicy [as 别名]
# 或者: from plone.app.iterate.interfaces.ICheckinCheckoutPolicy import getBaseline [as 别名]
 def handle_check(self):
     policy = ICheckinCheckoutPolicy(self.context)
     baseline = policy.getBaseline()
     if baseline is None:
         baseline = self.context
     return self.request.response.redirect(baseline.absolute_url())
开发者ID:eea,项目名称:eea.climateadapt.plone,代码行数:8,代码来源:views.py


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