=============
 Master data
=============

There are some masterdata which can be edited by persons who are allowed to.

>>> from icemac.addressbook.testing import create_addressbook
>>> from zope.app.wsgi.testlayer import Browser
>>> create_addressbook()
<AddressBook u'ab' (u'test address book')>

There is a master data overview which shows all parts the user can
see, this differs between the roles.

Manager
=======

At first we log in as manager:

>>> manager = Browser()
>>> manager.addHeader('Authorization', 'Basic mgr:mgrpw')
>>> manager.open('http://localhost/++skin++AddressBook/ab')
>>> manager.getLink('Master data').click()
>>> print manager.contents
<!DOCTYPE ...
<div id="content">
      <h2>Edit master data</h2>
      <ul class="bullet">
        <li>
      <a href="http://localhost/++skin++AddressBook/ab/++attribute++keywords"><span>Keywords</span></a>
    </li>
    <li>
      <a href="http://localhost/++skin++AddressBook/ab/++attribute++principals"><span>Users</span></a>
    </li>
    <li>
      <a href="http://localhost/++skin++AddressBook/ab/++attribute++entities"><span>Entities</span></a>
    </li>
      </ul>
    </div>
        </div>...

Editor
======

A user with the editor role sees the following parts:

>>> editor = Browser()
>>> editor.addHeader('Authorization', 'Basic editor:editor')
>>> editor.open('http://localhost/++skin++AddressBook/ab')
>>> editor.getLink('Master data').click()
>>> print editor.contents
<!DOCTYPE ...
      <div id="content">
  <h2>Edit master data</h2>
  <ul class="bullet">
  <li>
  <a href="http://localhost/++skin++AddressBook/ab/++attribute++keywords"><span>Keywords</span></a>
</li>
  <li>
  <a href="http://localhost/++skin++AddressBook/ab/++attribute++principals"><span>Users</span></a>
</li>
</ul>
</div>
</div>...


Visitor
=======

A user with the visitor role sees the fewest parts:

>>> visitor = Browser()
>>> visitor.addHeader('Authorization', 'Basic visitor:visitor')
>>> visitor.open('http://localhost/++skin++AddressBook/ab')
>>> visitor.getLink('Master data').click()
>>> print visitor.contents
<!DOCTYPE ...
      <div id="content">
      <h2>Edit master data</h2>
      <ul class="bullet">
        <li>
      <a href="http://localhost/++skin++AddressBook/ab/++attribute++keywords"><span>Keywords</span></a>
    </li>
    <li>
      <a href="http://localhost/++skin++AddressBook/ab/++attribute++principals"><span>Users</span></a>
    </li>
      </ul>
    </div>
   </div>...