<?xml version="1.0"?>
<object name="BikaSetup"
        meta_type="Factory-based Type Information with dynamic views"
        xmlns:i18n="http://xml.zope.org/namespaces/i18n"
        i18n:domain="senaite.core"
        purge="True">

  <property name="title" i18n:translate="">Setup</property>
  <property name="description"></property>
  <property name="content_icon">senaite_theme/icon/setup</property>
  <property name="content_meta_type">BikaSetup</property>
  <property name="product">bika.lims</property>
  <property name="factory">addBikaSetup</property>
  <property name="add_view_expr"></property>
  <property name="link_target"></property>
  <property name="global_allow">False</property>
  <property name="allow_discussion">False</property>
  <property name="default_view_fallback">False</property>

  <!-- No objects can be added here from the UI -->
  <property name="filter_content_types">True</property>
  <property name="allowed_content_types">
  </property>

  <!--
       Always redirect the user to base_edit, to which only users with "Modify portal
       content" permission granted will have access.

       The reason is that this type needs the permission "View" granted for
       "Authenticated" role. Otherwise, Client users and others will not be able to
       reach setup's children (e.g. Sample Types, Profiles, etc.). Nevertheless, we
       don't want users other than those with "Modify portal content" privilege to
       access to the plain view of this folder, cause it contains high-level settings
       and other sensible information, such as "Password lifetime", "Default turn
       around time for analyses", etc.

       Note Authenticated users will still be able to get information from those
       fields by other means (e.g. JSON.API), but at least, they won't be able to
       reach the plain view

       TODO: Security: Move all Schema's fields from Setup to a new type
  -->
  <alias from="(Default)" to="base_edit"/>
  <alias from="base_view" to="base_edit"/>
  <alias from="edit" to="base_edit"/>
  <alias from="view" to="base_edit"/>

  <action title="View"
          action_id="view"
          category="object"
          condition_expr=""
          url_expr="string:${object_url}"
          i18n:attributes="title"
          i18n:domain="senaite.core"
          visible="False">
    <permission value="View"/>
  </action>

  <action title="Edit"
          action_id="edit"
          category="object"
          condition_expr=""
          url_expr="string:${object_url}/edit"
          i18n:attributes="title"
          i18n:domain="senaite.core"
          visible="False">
    <permission value="Modify portal content"/>
  </action>

</object>
