The following example shows how to creaate and set permissions for a ``curator``
role that is allowed to insert, update, or delete any entity apart from a set of
RecordTypes and properties that define a "core data model" which can only be
altered whith administration permissions.
In the following, you'll learn how to
1. create the ``curator`` role.
2. configure the ``global_entity_permissions.xml`` s.th. the ``curator`` role is
allowed to insert, update, or delete any entity by default.
3. use a Python script to override the above configuration for the entities in
the externally defined core data model.
Prerequisites
-------------
This example needs some preparations regarding your CaosDB setup that have to
(or, for the sake of simplicity, should) be done outside the actual Python
example script.
The curator role
~~~~~~~~~~~~~~~~
First, a ``curator`` role is created with a meaningful description. We'll use
``caosdb_admin.py`` for this which leads to the following command:
.. code:: console
$ caosdb_admin.py create_role "curator" "A user who is permitted to create new Records, Properties, and RecordTypes but who is not allowed to change the core data model."
To actually see how this role's permissions change, we also need a user with
this role. Assume you already have created and activated (see
:doc:`Administration <../administration>`) a ``test_curator`` user, then
``caosdb_admin.py`` is used again to assign it the correct role: