Forum Replies Created

Viewing 15 posts - 406 through 420 (of 2,514 total)
  • Author
    Posts
  • Vladimir
    Keymaster

    Clarify also what do you mean under “user can ONLY view certain page IDs”. I suppose – view allowed pages at the list of pages available for editing at the wp-admin, right?

    Vladimir
    Keymaster

    Hi,

    Can not repeat this at the latest test. Check if user has another role(s) granted, which has edit restrictions also and may change the result which you wish.

    in reply to: Allow access to asset cleanup pro plugin #7268
    Vladimir
    Keymaster

    Hi,

    Thanks for the provided information. WPACU plugin uses ‘administrator’ role by default as the permission when defines its admin menu and checks current user permissions.
    But it allows to replace ‘administrator’ with custom permission via filter. For example, code below provides access to WPACU plugin for any user with ‘manage_options’ capability:

    
    add_filter('wpacu_access_role', 'replace_wpacu_admin_permission', 10, 1 );
    function replace_wpacu_admin_permission( $cap ) {
        $cap = 'manage_options';
    
        return $cap;
    }
    

    You can add it to the functions.php file of your active theme.

    Vladimir
    Keymaster

    Is ‘Site Manager’ role created by some plugin? I suppose the situation when that plugin recreates this role every time its loaded.
    What if you add ‘manage_options’ to any other role? Will it stay there?
    If Yes, use workaround – assign role with ‘manage_options’ to the user with ‘Site Manager’ role as the 2nd one.

    in reply to: Allow access to asset cleanup pro plugin #7263
    Vladimir
    Keymaster

    Hi,

    Share plugin .zip with support [at-sign] role-editor.com via DropBox, Google Drive or similar service. I will look what permissions it requires. I install such software locally and use in the investigation purpose only.

    in reply to: Defining Posts View Access in php #7260
    Vladimir
    Keymaster

    Look if 99 post has category, which also has view restriction at category level. It’s just assumption about possible conflict with a hook. It should not take place though.

    It it will not help. I can look at your data on site tomorrow. If it’s applicable send URL and admin login credentials to support [at-sign] role-editor.com

    in reply to: Defining Posts View Access in php #7258
    Vladimir
    Keymaster

    Really, when you create new role as a copy of ‘none’, URE adds to it at least one capability – ‘read’. Does your role has it? I did not make tests with absolutely empty roles.

    It should not have difference what role do you use built-in or custom one. Role should exist and current user should have it.

    I used ‘author’ role as an example only, it does not play a key role, what role to use.

    in reply to: Defining Posts View Access in php #7256
    Vladimir
    Keymaster

    Btw., if you use any caching plugin, try to use different computers for testing view access.

    in reply to: Defining Posts View Access in php #7255
    Vladimir
    Keymaster

    OK. I made own test.
    Set for the post ID=3267 at the post editor these values:
    – View Access: Prohibit view;
    – For Users: All visitors (logged in or not);
    – Action: Return HTTP 404 error.

    As a result the post is not accessible for not logged-in and logged-in users.
    Then I added the code:

    
    add_filter( 'ure_content_view_access_data_for_role', 'my_content_view_access_data_for_role', 10, 2 );
     
    function my_content_view_access_data_for_role( $restriction, $role_id ) {
        if ( $role_id=='author' ) {
            $restriction['access_model'] = 2;
            $restriction['access_error_action'] = 1;
            $restriction['data']['posts'] = array( 3267 );   // posts/pages ID list
        } 
     
        return $restriction;
    }
    

    The post is not accessible for not logged-in and logged-in users with any role except administrator and author.

    in reply to: Defining Posts View Access in php #7252
    Vladimir
    Keymaster

    Hi,

    I need first to allow “All user login” to view these Posts

    Why do you need this? Did you try to prohibit view for all user login for those posts at the post level and overwrite the condition via hook for select role(s) only? I mean restriction define at the hook will be final and overwrite one which define earlier at the post editor.

    in reply to: Defining Posts View Access in php #7249
    Vladimir
    Keymaster

    Hi,

    Yes, it’s possible. Just select suitable access model:

    $restriction[‘access_model’] = 1; // Prohibit view
    and
    $restriction[‘access_model’] = 2; // Allow view

    $restriction[‘data’][‘posts’] = array( 10, 20, 30 ); // posts/pages/custom post types ID list

    Post ID array works for any post type: as WordPress built-in posts and page, as any custom post type.

    in reply to: Hide "Other Roles" control #7245
    Vladimir
    Keymaster

    While code version above work for the user with ‘user-manager’ role only, this version works for all users including one with ‘administrator’ role:

    
    add_filter('ure_show_additional_capabilities_section', 'ure_show_additional_capabilities_section');
    
    function ure_show_additional_capabilities_section( $show ) {
    
    /*  Remove comment if do not wish to apply this for administrators also  
        $lib = URE_Lib::get_instance();
        if ($lib->is_super_admin()) {
            return $show;
        }
    */            
        return false;
    }
    
    Vladimir
    Keymaster

    “Popup Builder” plugin has own permissions settings. You have to add web_master role to the list of roles, for which “Popup Builder” is available at its “Settings” page.

    Vladimir
    Keymaster

    Hi,

    Is it possible to look at your site with admin permissions?
    If Yes, send URL and credentials to support[at-sign] role-editor.com

    in reply to: Post View Restrictions by Category #7234
    Vladimir
    Keymaster

    Yes, ‘block’ rule has a higher priority. If post has few categories assigned and at least 1 of them is prohibited for view to the current user role – user can not see this post.
    Look if you can to re-structure your categories to exclude the mentioned overlapping.

Viewing 15 posts - 406 through 420 (of 2,514 total)