azerbini / eamena_dev

Arches is a web-based, geospatial information system for cultural heritage inventory and management.
GNU Affero General Public License v3.0
1 stars 2 forks source link

Add geometry to admin groups #56

Open TeriForey opened 5 years ago

TeriForey commented 5 years ago

Description of Change

Added in the changes from the eamena_v3 PR

Issues Solved

eamena_v3 61 eamena_v3 62 eamena_v3 63 eamena_v3 65 eamena_v3 66

Types of changes

Checklist

Further comments

To get this working you first need to install olwidget:

$ pip install django-olwidget

The accompanying js, css and template files have already been added to the branch.

You'll also need to add the new column to the PostgreSQL table:

arches_eamena=# select AddGeometryColumn ( 'public', 'auth_group', 'geom', 4326, 'geometry', 2);

Finally, the changes in the arches_overrides files need to be installed so when inside the virtual environment run python setup.py install in the eamena_dev directory.

Each group should now contain a widget to set the geometry. The three basic groups 'read', 'edit' and 'editplus' should be edited so that the geom contains all of the EAMENA data. Any new group that starts with 'edit' (e.g. editsyria) will give the user permission to edit and create resources within that geometry. Any groups starting with 'editplus' will give the user delete permission within that geom. Groups that start with 'restrict' will remove all permissions, including view, for that area. Thus users can be part of multiple 'read', 'edit', 'editplus' and 'restrict_' groups to define which resources they can access based on their location. Mulitple KML files can be drag and dropped onto the map area on the admin page to define the geometries.

FYI, some fairly basic things have been changed, for example the middleware that creates the user.user_groups list now creates a string. This means that any group which contains the substring 'edit' will be recognised without the user having to be part of the explicit 'edit' group. This shouldn't cause any problems within this PR, but is worth noting for future development.