Support » Plugin: Post Duplicator » Role Capability to use it

  • devnik

    (@devnik)


    Hi,

    in my case only one Role should be able to duplicate posts (custom post type in my case).

    I didn’t see any capability check in your code. Maybe I just didn’t found it. As an solution I just remove it from the row actions:

    add_filter( 'post_row_actions', array($this,'remove_row_actions'), 10, 1 );
    public function remove_row_actions( $actions)
        {
            //The Post Duplicator Plugin doesn't check for an capability himself
            //So we have to remove it from the action row at a post
            //In our case only the Admin can duplicate posts
            if( get_post_type() === 'sa_classbook_course' && !current_user_can('administrator'))
                unset( $actions['duplicate_post'] );
            return $actions;
        }

    Maybe you could just create a new capability and check for it ?

    I Posted my solution for someone else who got this problem too.

Viewing 1 replies (of 1 total)
  • campusboy

    (@campusboy1987)

    @devnik thank you very much for the decision! I also came here to write about the fact that a user with the role of “Author” can clone someone else’s records. I really did not like it 🙁

Viewing 1 replies (of 1 total)
  • The topic ‘Role Capability to use it’ is closed to new replies.