Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UNESCO IHP-WINS] Allow UNESCO-IHP's admins to make a final check on every data uploaded before it goes visible by everyone. #175

Closed
cezio opened this issue Apr 28, 2017 · 9 comments
Assignees

Comments

@cezio
Copy link

cezio commented Apr 28, 2017

This is to prevent public sharing of incorrect data or metadata incorrectly filled.
Every time new data is uploaded, admins must be notified to be able to check it. Until that verification is done, data remains visible only by its owner and IHP's admins. Once it is checked, IHP's admins change data permissions to make it visible according to its owner's will.

@cezio
Copy link
Author

cezio commented Apr 28, 2017

my idea here:

  • this changes upload behavior. I guess current users would like to stay with current behavior, so I'll add switch in settings, ADMIN_MODERATE_UPLOADS (or something like that)
  • because this affects layers, documents and maps, I'll add ResourceBase.created_notification(), which will be called in upload views. I believe we want to avoid notifications when resource is created from script (backup restore, geoserver sync etc).
  • currently user can specify permissions during upload. I'm not sure what to do with it. I see few options:
  • hide permissions ui if feature is on
  • ignore permissions
  • leave it as it is, admin can change that
  • about permissions, I don't see any ui in admin. can we point admin to regular resource view to edit permissions?

@afabiani
Copy link
Member

Your proposal is ok, please proceed ad you specified.

About permissions, I would leave them as they are (if possible) and hide the "unpublished" resource to users not belonging to Admin group (staff members) and the Owner of the resource.

If not possible, I would force the permissions and hide the form when uploading.

It would be great if there is also the possibility from the admin dashboard to choose which "Groups" or "Users" may edit "unpublished" resources, or at least enable an "Editor" checkbox (similar to "Staff") allowing them to view unpublished resources.

WARNING It must be very clear from the UI which are "Draft" resources. Maybe a different color or a red asterisk.

@cezio
Copy link
Author

cezio commented Apr 28, 2017

(if possible) and hide the "unpublished" resource to users not belonging to Admin group (staff members) and the Owner of the resource.

The quickest way would be to set it as unpublished. Permissions would be preserved as selected by user.

i've noticed this setting: http://docs.geonode.org/en/master/reference/developers/settings.html#resource-publishing
it seems to be used with documents only, sets published flag to False if enabled. I'm not sure if I can reuse it and extend it's usage. It works in similar way, but it's not yet applied to layers or maps.

@cezio
Copy link
Author

cezio commented Apr 28, 2017

there's additional app, https://github.com/GeoNode/geonode-notification which probably could be used for notifications. I'll check if will it work here

@cezio cezio changed the title [UNESCO IHP-WINS] Allow UNESCO-IHP's admins to make a final check on every data uploaded before it goes visible by everyone. [UNESCO IHP-WINS] Allow UNESCO-IHP's admins to make a final check on every data uploaded before it goes visible by everyone. May 4, 2017
@cezio
Copy link
Author

cezio commented May 4, 2017

Geonode-notification app is out-of-date. It's based on old version of pinax app, which has been updated since last commit there. It has several template inheritance problems:

From chat with Alessio: GeoNode notifications are under big rewrite in master branch (new GN version will require AMQP broker running: GeoNode#2889), making current notifications infra obsolete.

I'll add code that will mark affected resource types as unpublished, when created from upload. Admin will be able to switch objects on in edit view. Permissions will be preserved. I guess notifications part will be handled independently with new infrastructure.

cezio added a commit to cezio/geonode that referenced this issue May 4, 2017
@cezio cezio self-assigned this May 5, 2017
@cezio
Copy link
Author

cezio commented May 8, 2017

At the moment, my plan (partially implemented) is:

  • when moderation flag is on, uploads will have is_published flag set to False by default.
  • notifications will be handled with notifications app (pinax-notifications), so there would be no code duplication. Notifications handle resource changes, and are configurable.

I see a place for small improvements here. Currently notifications are send after each change. We could add separate notification types for moderation only, which will be send only if change is from different user, and only from view (so no flood of notifications when data are updated from scripts).

@cezio
Copy link
Author

cezio commented May 10, 2017

Main difference between geonode-user-account and upstream's django-user-account is account registration moderation and invitations. i'm not sure if new version of pinax app can do invitations. We can move this functionality to separate app. Registration moderation can be implemented in geonode core, work optionally only if account app is installed (similar to notifications), and be hooked with signals.

My idea here is to:

  • use pinax django-user-account app,
  • move invitations to geonode-account app (and thin it a lot from rest of the code)
  • move registration moderation to signal handler

There's also one more aspect to remember: data migration between apps. i can write simple script that would copy table contents from old apps to new ones

@cezio
Copy link
Author

cezio commented May 12, 2017

move invitations to geonode-account app (and thin it a lot from rest of the code)
move registration moderation to signal handler

This changed a bit:

@cezio
Copy link
Author

cezio commented May 15, 2017

This is implemented:

  • when ADMIN_MODERATE_UPLOADS flag is set, all uploads will be unpublished by default
  • notifications will be handled by pinax-notifications app.

Waiting for GeoNode#3047 to be merged into geonode

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

No branches or pull requests

2 participants