WordPress.org

Ready to get started?Download WordPress

Forums

Changing the way user levels work... (18 posts)

  1. Turnip
    Member
    Posted 9 years ago #

    Is there a way that I can change it so that users of *the same* user level, instead of only being able to edit posts of users below them, can also edit *each other's* posts. Specifically, I'd like all users of level 5 to be able to edit posts by users of level 5 downwards.

    Cheers,
    Turnip

  2. moshu
    Member
    Posted 9 years ago #

    Prior to v1.5 everybody was complaining... and asking the devs to make NOT possible for users of the same level to edit each other's post.
    Curiously, people always want something that is not in the script :)

  3. NuclearMoose
    Member
    Posted 9 years ago #

    @moshu,
    I knew that we would see this one day!
    @turnip,
    It's likely you'd have to twist the arm of a plugin developer to give you this functionality.

    Maybe Coffee2Code is looking for something to do! :)

  4. Turnip
    Member
    Posted 9 years ago #

    Okay, thanks for the replies both of you.

    I can write the plugin myself, but I'd be grateful if you could point me in the right direction, in terms of what I'd have to do : ).

    (Also, instead of going one way of t'other, it could have been made a option -- but there are things I'm more concerned about, so I'll quit complaining ; )

  5. phred_
    Member
    Posted 9 years ago #

    I am very interested in a solution of this problem too. And that option would be fine.. :-)

  6. phred_
    Member
    Posted 9 years ago #

    Ok, I figured it out myself:
    in wp-includes/functions-post.php
    in function "user_can_edit_post" (that is on line 357) change $author_data->user_level > $post_author_data->user_level to $author_data->user_level >= $post_author_data->user_level
    Good that the variables have speaking names! IMO good coding style..!

  7. schulte
    Member
    Posted 9 years ago #

    Just had a need for this myself, and did the change you suggested phred. I did have to make one more additional correction.

    wp-includes/functions-post.php, line 398 -- to get the Edit/Delete to appear in the Manage>Posts section.

    if ( $user->user_level > $other->user_level || $user->user_level > 8 || $user->ID == $other->ID )

    to

    if ( $user->user_level >= $other->user_level || $user->user_level > 8 || $user->ID == $other->ID )

  8. mongo
    Member
    Posted 8 years ago #

    a similar question but with comments: currently on 1.5 users cannot edit their own comments unless you up their level to a certain point. however, at this point they can edit the comments of everyone at their level. is it possible to change something to allow registered users to only edit their own comments?

  9. ongakukaku
    Member
    Posted 8 years ago #

    interesting how some would like users to be able to edit other users posts, i'd prefer to not allow anyone to edit someone elses posts except admin, who's insane idea was this ? lol

    i also wonder if there's a way to secure the blog from public at least some areas for the people who aren't registered. Infomation especially personal should not be so easy to come by it should be considered sacred and protected :)

  10. mongo
    Member
    Posted 8 years ago #

    what i am asking for is something very different: allow registered members to edit their own comments but not those of anyone else (at their level or below). hope someone's working on a plugin that fixes this missing feature for any group blog.

  11. craveytrain
    Member
    Posted 8 years ago #

    one more note, if you choose to do the same thing with pages, you need to make an edit in wp-admin/edit-pages.php as well.

    FROM:
    AND ($wpdb->users.user_level < $user_level OR $wpdb->posts.post_author = $user_ID)
    TO:
    AND ($wpdb->users.user_level <= $user_level OR $wpdb->posts.post_author = $user_ID)

  12. Daisyhead
    Member
    Posted 8 years ago #

    Ok, I figured it out myself:
    in wp-includes/functions-post.php
    in function "user_can_edit_post" (that is on line 357) change $author_data->user_level > $post_author_data->user_level to $author_data->user_level >= $post_author_data->user_level

    Okay, what version of WP are you guys making these modifications to? I am using V1.5 (I don't have time to upgrade any time soon) but I want to use the Post Levels plugin. My only problem is that I do not want registered users to be able to post or edit ANYTHING on my blog. I have searched the template files listed above but cannot find the code to tweak.

    Does anyone have any suggestions?

  13. vkaryl
    Member
    Posted 8 years ago #

    Would all be 1.5 incremental versions, Daisyhead. First post was in March....

    I believe that as long as you require registration, but never promote above 0 level, people shouldn't be able to post. I may be wrong about that (I've never tried posting as a 0 level myself....)

    Okay, just created a 0 level user, all that user can see is the Dashboard and its own profile page and a logout option.... no posting.

  14. Daisyhead
    Member
    Posted 8 years ago #

    You're right Vkaryl, but they can't see the "private" entries either if I set leave their level set at 0.

  15. Daisyhead
    Member
    Posted 8 years ago #

    And, If I set the post_level value on a private entry to 1, then anyone with a level of 0 cannot read the private entry. If I change the post_level value to 0, then that means that ANYONE who registers on my blog (since you are automatically assigned a level of 0 when you first register) can read the private entries as soon as they register. That kind of defeats the purpose of the private entries.

    I just read up on V2.0 of WP and how the roles and capabilities work. It sounds just like what I need so I will more than likely have to upgrade in order to get the functionality out of this plugin that I need, but I just don't have time anytime soon to upgrade. *sigh*

    Why so difficult?? ;-)

  16. Michael Bishop

    Posted 8 years ago #

    daisy, if you follow the instructions for backing up, and upgrading, it really shouldn't take much more time than it did to post your previous 2 posts. Perhaps slightly longer with 2.0, but only if you have a multitude of plugins.

    Also, I believe there is already a post-levels plugin for earlier versions, no?

  17. Daisyhead
    Member
    Posted 8 years ago #

    There are earlier versions of the post-levels plugin, yes, but they don't work they I want them to with the version of WP (1.5) that I am currently running.

    I was trying to see if I could find a fix for the current version of the post-levels plugin (V0.2.1) that I'm using until I can upgrade my WP. My problem with upgrading my WP is that I use a lot of plugins and have made quite a bit of modifications to certain files, but I can't remember which ones I actually made the modifications to. The actual upgrading of WP never takes long, it's the tweaking to get it all back the way I want it, that takes the most time.

    I suppose I will just have to bite the bullet and upgrade although I don't want to right now. I'm just being stubborn. There has to be a way to do what I want to do with the version of the post levels plugin that I'm using right now, which is only show my private entries to registered users with a level of 1 or higher, but restrict their ability to post on my blog or edit anything within my blog admin interface.

  18. Daisyhead
    Member
    Posted 8 years ago #

    Fil, the creator of this plugin, posted some code tweaks if anyone is interested in using the Post Levels plugin V0.2.1 with WP 1.5. They are as follows:

    * wp-admin/menu.php (change the second parameter for all the menus to 10)
    * wp-admin/profile.php (check for user_level = 10 before showing a user’s level)
    * wp-admin/user-edit.php (change it so only user_level = 10 can edit [look for if ($edituser->user_level >= $user_level)]

    Hth someoneone else!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.