WordPress.org

Support

Support » Requests and Feedback » User levels by role not number?

User levels by role not number?

  • It would be nice to have a meta layer between the user – level construct.

    I would like some users to have level 4, but also be able to ….

    Life never fits quite into the boxes.

    How about having either:

    a) You assign roles to users (with defaults).
    b) You assign the roles to a level. So in my install level 9 may be different to yours.

    I would much rather do this in meta land, than going into:

    function user_can_edit_post($user_id, $post_id, $blog_id = 1) {
    $author_data = get_userdata($user_id);
    $post = get_post($post_id);
    $post_author_data = get_userdata($post->post_author);

    if ( (($user_id == $post_author_data->ID) && !($post->post_status == ‘publish’ && $author_data->user_level < 2))
    || ($author_data->user_level > $post_author_data->user_level)
    || ($author_data->user_level >= 10) ) {
    return true;
    } else {
    return false;
    }
    }

    and changing the user_level >= 8 :/

    Any thoughts?

    Cheers,

    Dion

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘User levels by role not number?’ is closed to new replies.