Forum Replies Created

Viewing 15 posts - 1,501 through 1,515 (of 2,520 total)
  • Author
    Posts
  • Vladimir
    Keymaster

    Hi,
    In order to force bbPress to use ‘delete_replies’ and ‘delete_topics’ capabilities for content authours add this code to your active theme functions.php file or setup it as a “must use” plugin:

    
    add_filter('bbp_map_reply_meta_caps', 'bbp_delete_own_replies', 10, 4);
    
    function bbp_delete_own_replies($caps, $cap, $user_id, $args) {
        if ($cap!=='delete_reply' || in_array('do_not_allow', $caps)) {  
            return $caps;        
        }
        
        $_post = get_post( $args[0] );
        if (empty($_post)) {
            return $caps;
        }
        
        if ($_post->post_author==$user_id) {
            $caps = array('delete_replies');
        }
        
        return $caps;    
    }
    
    add_filter('bbp_map_topic_meta_caps', 'bbp_delete_own_topics', 10, 4);
    
    function bbp_delete_own_topics($caps, $cap, $user_id, $args) {
    
        if ($cap=='delete_topic' || in_array('do_not_allow', $caps)) {
            return $caps;
        }
        
        $_post = get_post( $args[0] );
        if (empty($_post)) {
            return $caps;
        }
        
        if ($_post->post_author==$user_id) {
            $caps = array('delete_topics');
        }
        
        return $caps;
    }
    
    Vladimir
    Keymaster

    Hi Shweta,

    There are no network level roles at WordPress. Be aware that when you work with roles at the “Network Admin->Users->User Role Editor”, you work with roles of the main site of a network really. “Network Update” from there overwrites roles of any other subsite of this network with roles from a main site of that network. So any changes made to the roles at subsite are lost after you click ‘Network Update’. All subsites get an exact copy of capabilities and roles from the main site.

    It’s possible to send to subsites just one role from a main site and do not touch any others. Go to the main site “Users->User Role Editor”, select role, turn ON “Apply to All sites” option at the top of a page and click “Update” button. Only current role will be replicated to subsites in this case.

    Vladimir
    Keymaster

    Hi,

    These elements are named meta boxes at a WordPress. Yes, it’s possible to hide them for a role using ‘Meta boxes access‘ add-on.

    in reply to: Can't revoke access custom post types #3906
    Vladimir
    Keymaster

    I got ‘My Testimonial’ plugin. Thanks. I don’t see any problem with access to it at my test installation. It’s a capabilities set for WP built-in ‘post’ by default or capabilities set for ‘imtst_testimonials’ custom post type in case you turned ON URE Pro’s option ‘force custom post types to use own capabilities’.

    I tried to look on the current settings at your site, but a user you provided to me does not have admin privileges currently.

    I will can to say more on WPML too if/when you refresh my access to your site.

    Vladimir
    Keymaster

    Hi,

    Can ‘GA Site Administrator’ role edit this page? URE does not apply content view restrictions to a page in case current user can edit this page. This is a default behavior.

    In case you need to change this, you can set a custom hook ‘ure_restrict_content_view_for_authors_and_editors‘.

    in reply to: Woocommerce #3904
    Vladimir
    Keymaster

    Hi,

    Send me a screenshot of ‘content view restrictions’ section of a store page. I will try to reproduce an issue and check what is going wrong there.

    Vladimir
    Keymaster

    Hi,

    I will try to help you as I return to office, at June, 29th.

    Vladimir
    Keymaster

    It’s possible to modify a default bbPress access model using its custom filters:
    ‘bbp_map_reply_meta_caps’, ‘bbp_map_topic_meta_caps’.

    Vladimir
    Keymaster

    Hi,

    bbPress uses a different model of work with topics and replies privileges comparing to the WordPress posts. While bbPress adds ‘delete_topics’, ‘delete_replies’ it really uses just ‘delete_others_topics’ (includes/topics/capabilities.php, line #180) and ‘delete_others_replies’ (includes/replies/capabilities.php, line #162). So default bbPress permissions model does not allow to a user to delete his own content. User should have a ‘moderate’ or ‘delete_others_%’ capability to get access to delete operation. But with this access user can delete a content from any user/author.

    in reply to: Can't revoke access custom post types #3891
    Vladimir
    Keymaster

    Hi Benny,

    You helped me to find a bug in admin menu access add-on. Thanks. I will develop a fix next week as I return home from a short trip. It will take some time for testing before I can to publish the update.

    A quick workaround is to add ‘edit_portfolios’ capability to the role and block all ‘Portrolio’ menu items via the same admin menu access add-on. I did this at your site and user with ‘Klant’ role does not have access to the ‘Portfolio’ menu.

    in reply to: Can't revoke access custom post types #3888
    Vladimir
    Keymaster

    I reproduced the issue with ‘Portfolio post type’ plugin. I will investigate it and inform you about a result.

    in reply to: Can't revoke access custom post types #3887
    Vladimir
    Keymaster

    Hi Benny,

    Can you share for me ‘My Testimonials’ plugin copy via dropbox or similar service. I will look on its permissions at my local development environment.

    Vladimir
    Keymaster

    You are right, I updated my previous answer: at “Additonal Modules” tab.

    Correct: while plugin is network activated you have one global for the whole network default access error message.

    If you network deactivate plugin and activate it individually for selected subsites, you can have individual for every subsite settings.

    Other option – input custom shortcode as a network global access error message template. Then built a message individual for subsite inside a PHP processing that shortcode.

    Vladimir
    Keymaster

    You can set a default access error message at the “Setting->User Role Editor->Additional Modules” tab. URE will show it until you do not select ‘Show custom access error message’ for a restricted post at the post editor page.

    Yes you can use shortcode inside content view access error message.

    in reply to: Can't revoke access custom post types #3879
    Vladimir
    Keymaster

    Thanks. I answered to you by email. Let me know if you need a further help.
    I repeat my answer here if it will be useful for someone other:

    General steps when you don’t know what permissions are required for some admin menu items:

    – Open Users->User Role Editor
    – Select ‘Administrator’ role
    – Open “Admin menu”
    – Find needed menu item and look what capability protects it. “WP Quiz->Players” is protected by ‘manage_options”.
    – Close “Admin menu” window
    – Select other role
    – Add required capability (‘manage_options’ in this case) to this role
    – Update it.
    – Open ‘Admin menu’ for this role
    – Block unneeded menu items for this role.

Viewing 15 posts - 1,501 through 1,515 (of 2,520 total)