Easy-digital-downloads: Enhancement: Allow removal of Insert download button on the page/post screens

Created on 13 Sep 2018  路  5Comments  路  Source: easydigitaldownloads/easy-digital-downloads

Bug Report

Expected behavior

Customer has a few authors and editors and he don' want them to be able to see that button

Actual behavior

Visible for everyone i believe and no way to hide/remove it

Steps to reproduce the behavior

1) Try to add/edit page/post as any user role and the Insert Download button is above the editor

Information (if a specific version is affected):

PHP Version: All

EDD Version (or branch): Latest

WordPress Version: Latest

Any other relevant information:
Original customer report: https://secure.helpscout.net/conversation/662581447/90164?folderId=180499
Perhaps if not allowing for it to be disabled by a filter then maybe a more granular approach and showing it for specific (filtered) user roles ?

Most helpful comment

I agree with @amdrew there regarding user permissions.

Personally, I believe that shortcodes should have feature parity with blocks, at least as far as what they output on the front-end. Because no shortcodes truly support user-permissions (they can be typed right into TinyMCE), adding user permissions to any Gutenberg Block that replicates the [purchase_link] shortcode would break feature parity. I vote we hold off on this.

All 5 comments

I'd like to avoid any work around this button currently. With Gutenberg on the roadmap for the future of WordPress and EDD Blocks being developed by @amdrew, I'd be comfortable saying that button won't be around much longer in general

@SDavisMedia @mintplugins @amdrew is that a safe assumption that the Blocks for EDD will just replace that button at the top of the TinyMCE editor? It poses a few issues for us already and requires us to add a bunch of JS where don't particularly like to anyway.

@cklosowski The Add Download button appears as though it will be killed in Gutenberg, along with all other action buttons sitting above TinyMCE. When the EDD Block for inserting a download is created we can make sure it supports user permissions.

^ Correct, you can insert a "classic" block to get tinymce but there's no insert download button:

screen shot 2018-10-03 at 12 15 20 pm

As @mintplugins mentions (and if we want to), we can prevent a block from being inserted based on a particular user role or capability.

Since the old "insert download" button just outputs the [purchase_link] shortcode, which doesn't have any user permission checks, I don't see a need to prevent any block from being inserted at this point.

I agree with @amdrew there regarding user permissions.

Personally, I believe that shortcodes should have feature parity with blocks, at least as far as what they output on the front-end. Because no shortcodes truly support user-permissions (they can be typed right into TinyMCE), adding user permissions to any Gutenberg Block that replicates the [purchase_link] shortcode would break feature parity. I vote we hold off on this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ismail-elkorchi picture Ismail-elkorchi  路  3Comments

DevinWalker picture DevinWalker  路  6Comments

scottbuscemi picture scottbuscemi  路  5Comments

davidsherlock picture davidsherlock  路  5Comments

colomet picture colomet  路  4Comments