Capability for overwriting/uploading files
-
I can’t figure out a capability configuration.
For admins and super admins (network) overwriting files etc. works fine.
However, I also created roles for users that are only allowed to manage downloads, nothing more.
For this to work I modified thecapability_type
parameter for thewpdmpro
post type.
(Code example below)add_filter( 'register_post_type_args', 'register_wpdmpro_args', 10, 2 ); function register_wpdmpro_args( $args, $name ) { if ( 'wpdmpro' === $name ) { // Custom capability for downloads. $args['capability_type'] = $name; } return $args; }
https://codex.www.ads-software.com/Function_Reference/register_post_type#capability_type
This way I can separateedit_post
andedit_wpdmpro
capabilities.
Unfortunately users who can’t access posts cannot overwrite wpdmpro posts.
Is there a better way to configure such roles/capabilities?Recap: The idea is to create a role that ONLY has access to the downloads, nothing more.
Thanks in advance!
Cheers, Jory
- The topic ‘Capability for overwriting/uploading files’ is closed to new replies.