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

Read-only Publish toggle on Entries #3039

Merged
merged 5 commits into from
Jan 5, 2021
Merged

Read-only Publish toggle on Entries #3039

merged 5 commits into from
Jan 5, 2021

Conversation

duncanmcclean
Copy link
Member

@duncanmcclean duncanmcclean commented Dec 19, 2020

This PR fixes #1011 where if the 'manage publish state' permission isn't checked on a role and when a user in the role tries, they would be able to toggle the publish state.

This PR fixes this bug from the front-end by passing in a new can-manage-publish-state prop of whether or not the user has permission to manage publish state on that collection.

However it does seem like it could be a good idea to also enforce this on the backend side as well. What do you think?

@jasonvarga
Copy link
Member

Thanks for the start on this. 👍

I've made some additions to this:

  • apply the read only logic to the "create" form
  • server side handling of the permission when saving an existing entry
  • let it work within the entries fieldtype stack
  • added a couple of placeholder tests as todos

@jasonvarga jasonvarga merged commit 5fb0a86 into statamic:3.0 Jan 5, 2021
@duncanmcclean duncanmcclean deleted the fix/publish-state-permissions branch January 5, 2021 22:18
@duncanmcclean
Copy link
Member Author

Awesome!

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.

"Manage publish state" permission not working
2 participants