-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add delete flag in configuration #707
Add delete flag in configuration #707
Conversation
Adds a `delete` flag to collections in `config.yml`. Defaults to false. This is mostly for use with files to restrict users from deleting settings files etc that available via the CMS.
c0aaf85
to
bfa2070
Compare
@rpullinger awesome, looks good! One change, though: this needs to default to I would also say just add a single example of this option's usage in the example project, trying to reduce the signal-to-noise ratio in there. Let me know if you have any other thoughts on any of this. Thanks again! |
@rpullinger I've pushed the changes @erquhart requested into the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
- Summary
Fixes #593. Adds a
delete
flag to collections inconfig.yml
. Defaults to false. This is mostly for use with files to restrict users from deleting settings files etc that are available via the CMS but can also be used to restrict the ability to delete within any collection.I'm currently not 100% sure about the how it should handle
delete
not being set for a collection. Ideally I'd have it like I've implemented where ifdelete
is not set then it counts asfalse
. This is how thecreate
flag works. My only worry is that when this feature is implemented and users upgrade they will suddenly find that unless they add the flag that they can't delete documents they could previously?EDIT — This now defaults to
true
- Test plan
Manually tested using example config using
yarn run start
.delete: true
– Visit http://localhost:8080/#/collections/posts/entries/2017-10-18-post-number-9 and ensureDELETE
button is visible and deletes the entry.delete: false
– Visit http://localhost:8080/#/collections/settings/entries/general and ensureDELETE
button is hidden.delete
not set – Visit http://localhost:8080/#/collections/kitchenSink/entries/a-big-entry-with-all-the-things and ensureDELETE
button is hidden.- Description for the changelog
Adds a
delete
flag to collections inconfig.yml
to restrict users from deleting important documents via the CMS.