def privacy_portlet_css(self):
     context = self._getContext()
     if (IInformationType.providedBy(context) and
         context.information_type in PRIVATE_INFORMATION_TYPES):
         return 'portlet private'
     else:
         return 'portlet public'
Beispiel #2
0
 def privacy_portlet_css(self):
     context = self._getContext()
     if (IInformationType.providedBy(context)
             and context.information_type in PRIVATE_INFORMATION_TYPES):
         return 'portlet private'
     else:
         return 'portlet public'
 def initialize(self):
     context = self._getContext()
     if IInformationType.providedBy(context):
         cache = IJSONRequestCache(self.request)
         json_dump_information_types(
             cache,
             context.getAllowedInformationTypes(self.user))
Beispiel #4
0
 def test_information_type_from_product(self):
     # ProductSeries should inherit information_type from its product."""
     owner = self.factory.makePerson()
     information_type = InformationType.PROPRIETARY
     product = self.factory.makeProduct(
         owner=owner, information_type=information_type)
     series = self.factory.makeProductSeries(product=product)
     with person_logged_in(owner):
         self.assertEqual(
             IInformationType(series).information_type, information_type)
Beispiel #5
0
    def initialize(self):
        """See `LaunchpadView`."""
        super(SnapAddView, self).initialize()

        # Once initialized, if the private_snap flag is disabled, it
        # prevents snap creation for private contexts.
        if not getFeatureFlag(SNAP_PRIVATE_FEATURE_FLAG):
            if (IInformationType.providedBy(self.context) and
                self.context.information_type in PRIVATE_INFORMATION_TYPES):
                raise SnapPrivateFeatureDisabled
 def information_type_description(self):
     context = self._getContext()
     if IInformationType.providedBy(context):
         return context.information_type.description
     return None
 def information_type(self):
     context = self._getContext()
     if IInformationType.providedBy(context):
         return context.information_type.title
     return None
 def information_type_description(self):
     """A view has the information_type_description of its context."""
     information_typed = IInformationType(self.context, None)
     if information_typed is None:
         return None
     return information_typed.information_type.description
Beispiel #9
0
 def information_type_description(self):
     context = self._getContext()
     if IInformationType.providedBy(context):
         return context.information_type.description
     return None
Beispiel #10
0
 def information_type(self):
     context = self._getContext()
     if IInformationType.providedBy(context):
         return context.information_type.title
     return None
Beispiel #11
0
 def initialize(self):
     context = self._getContext()
     if IInformationType.providedBy(context):
         cache = IJSONRequestCache(self.request)
         json_dump_information_types(
             cache, context.getAllowedInformationTypes(self.user))
Beispiel #12
0
 def _getContext(self):
     information_typed = IInformationType(self.context, None)
     if information_typed is None:
         return self.context
     return information_typed