By default P2 relies on user roles to check if a user can edit a post. If s/he can’t, the “edit” field is not displayed on the front page, and users cannot edit posts from the back end either.

The same goes for To-Do lists: is a user cannot edit a post containing a To-Do List, then s/he cannot tick or untick those boxes. If you would like to add this ability you need to tweak some code.

Have a look at a file called /inc/list-creator.php. On line 72 a check for the current user role is performed:

function current_user_can( $post_id = 0 ) {
return current_user_can( 'edit_post', $this->get_object_id( $post_id ) );
}

You can amend the last line to always return true, therefore every registered and logged-in user will be able to tick and untick those boxes:

function current_user_can( $post_id = 0 ) {
return true;
}

Users not logged in will not be able to change the state of the boxes.

Note: I have tested this with P2 v1.4.0, it may not work with other versions of the theme.

Advertisements