WordPress.org

Ready to get started?Download WordPress

Forums

User levels by role not number? (3 posts)

  1. dalmaer
    Member
    Posted 8 years ago #

    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

  2. moshu
    Member
    Posted 8 years ago #

    Maybe in the next version... we just have to wait patiently :)
    http://codex.wordpress.org/Version_1.6#User_Levels

  3. dalmaer
    Member
    Posted 8 years ago #

    Moshu,

    Awesome :)

    Thanks for leting me know.

    Cheers,

    Dion

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags