<!-- $Id$ -->

<configure
   xmlns:zope="http://namespaces.zope.org/zope"
   xmlns:browser="http://namespaces.zope.org/browser"
   i18n_domain="loops">

  <zope:adapter factory="loops.security.setter.BaseSecuritySetter" />

  <zope:class class="loops.security.common.WorkspaceInformation">
    <implements interface="zope.annotation.interfaces.IAttributeAnnotatable" />
    <allow interface="loops.security.interfaces.IWorkspaceInformation" />
    <require set_schema="loops.security.interfaces.IWorkspaceInformation"
             permission="zope.Security"/>
  </zope:class>

  <zope:adapter factory="loops.security.common.LocationWSI" />

  <zope:adapter
        for="loops.interfaces.IConcept"
        factory="zope.securitypolicy.rolepermission.AnnotationRolePermissionManager"
        trusted="true" />
  <zope:adapter
        for="loops.interfaces.IResource"
        factory="zope.securitypolicy.rolepermission.AnnotationRolePermissionManager"
        trusted="true" />
  <zope:adapter
        for="loops.interfaces.IView"
        factory="zope.securitypolicy.rolepermission.AnnotationRolePermissionManager"
        trusted="true" />

  <zope:adapter factory="loops.security.setter.ConceptSecuritySetter" />
  <zope:adapter factory="loops.security.setter.ResourceSecuritySetter" />

  <!-- might be commented out for performance reasons;
       TODO: control execution via global (or type?) options -->
  <zope:subscriber handler="loops.security.common.setDefaultSecurity" />
  <zope:subscriber handler="loops.security.common.grantAcquiredSecurity" />
  <zope:subscriber handler="loops.security.common.revokeAcquiredSecurity" />

  <zope:subscriber 
        handler="loops.security.common.addGroupMembershipOnAssignment" />
  <zope:subscriber 
        handler="loops.security.common.removeGroupMembershipOnDeassignment" />

  <!-- views -->

  <browser:page
        for="zope.annotation.interfaces.IAnnotatable"
        name="permissions.html"
        permission="zope.Security"
        template="browser/manage_permissionform.pt"
        class="loops.security.browser.admin.PermissionView"
        menu="zmi_actions" title="Edit Permissions" />

  <browser:page
        for="loops.interfaces.IConcept"
        name="grant.html"
        permission="zope.Security"
        template="browser/granting.pt"
        class="loops.security.browser.admin.Granting"
        menu="zmi_actions" title="Grant" />

  <browser:page
        for="loops.interfaces.IConcept"
        name="manage_workspace.html"
        permission="zope.Security"
        template="browser/manage_workspace.pt"
        class="loops.security.browser.admin.ManageWorkspaceView"
        menu="zmi_actions" title="Manage Workspace" />

  <!-- end user (audit) views -->

  <zope:adapter
      name="role_permission_by_type.html"
      for="loops.interfaces.IConcept
           zope.publisher.interfaces.browser.IBrowserRequest"
      provides="zope.interface.Interface"
      factory="loops.security.browser.audit.RolePermissionsByType"
      permission="loops.ManageSite" />

  <zope:adapter
      name="workspace_assignments.html"
      for="loops.interfaces.IConcept
           zope.publisher.interfaces.browser.IBrowserRequest"
      provides="zope.interface.Interface"
      factory="loops.security.browser.audit.WorkspaceAssignments"
      permission="loops.ManageSite" />

</configure>
