Suggestion for capability check
-
The plugin works great for me thanks!
Nevertheless I just come up with a suggestion to modify the capability check the plugin runs when a user attempts to crop an image. The plugin actually checks for “upload_files” and “edit_pages”.
This is a little inconvenient, as like the way it works now, a user with the role AUTHOR cannot crop images by default, (unless you add the edit_pages capability to the author role which is not an option in most cases). So the author is for example not able to crop the images he uploaded and attached to his self written and published blog post.I would suggest to not check for edit_pages, but to use the meta cap “edit_post” like so in your ‘isUserPermitted’-method.
current_user_can( 'edit_post', $attachment_id );
Like this, every user that can edit an attachment, would then also be able to crop it with your fantastic plugin.
- The topic ‘Suggestion for capability check’ is closed to new replies.