hmpf / easydmp

MIT License
7 stars 2 forks source link

Template revision/cloning/JSON import #208

Closed frafra closed 3 years ago

frafra commented 3 years ago

Given that it does not seem a good idea to change if there are DMP connected to that (see #207), it would be nice to be able to create a new template based on a previous one (like a new revision). Current templates can be exported as JSON file, but there is no import function for those files in the admin.

vbhavdal commented 3 years ago

@frafra There is a gray import button top right, that can be used for this, can't it?

frafra commented 3 years ago

@vbhavdal Sorry, I do not see it. I am using the instance running on easydmp.sigma2.no. I guess it could be a permission issue?

hmpf commented 3 years ago

There is a way to both clone an entire existing template, and to import an exported template, via the admin. It makes sense that this should be possible to those who are in the "Template Designer" group, as I think you are, @frafra. It shouldn't be too much work to add the necessary permissions. Those that only have access to editing a specific template will not be allowed this though.

hmpf commented 3 years ago

I realized: Django 2.1 added the support for "view"-permissions. It might be possible to change the admin so that published templates (with all its dependents) are read-only for everyone, including super-users. Then imported templates would be editable depending on whether the original was published or not.