Skip to content

Conversation

@TeriForey
Copy link
Collaborator

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

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • Unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

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. edit_syria) 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.

@azerbini azerbini changed the title V3 pr32 groupgeom Add geometry to admin groups Oct 1, 2018
…group geom sections into resource-manager in arches.app.views.resources
…tring. Also changed permission_required('edit') into a user_passes_test that looks for 'edit' within the group name
…oup geom. Had to change the js so that it works with aerial bing maps and had to alter the admin views to include the bing key from local settings
…their geography saved. Works with existing data too.
…eoms. Also added into canUserAccessResource function to return false if site is within restricted geom.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant