WordPress.org

Ready to get started?Download WordPress

Forums

User Role Editor
[resolved] s2Member / Per-User Capabilities (15 posts)

  1. PriMoThemes
    Member
    Posted 3 years ago #

    Hi there. Thanks for a great plugin!

    I'm the author of the s2Member plugin, and we are planning to refer some of our clients to your plugin.

    However, I was hoping you might be able to provide the ability to edit Capabilities on a per-User basis? This is possible internally, but I've not seen a plugin that makes it easily editable. Perhaps a tool in the User Editing Panel for WordPress?

    If you can add this feature, please let me know. I'll be willing to make a donation toward it's development.

  2. Vladimir Garagulya
    Member
    Plugin Author

    Posted 3 years ago #

    Hello,
    thanks.

    If I'm not wrong, WP has not built-in capability storage on per user basis. It stores role name assosiated with user in user_meta table meta_key 'wp_capabilities'. It is possible to store individual user capabilities somewhere and apply them to the user's capabilities context of course.
    But the same result could be achieved with the current realization if you create separate role for every user - use user name for role name, for example. Why not to go this way?

  3. PriMoThemes
    Member
    Posted 3 years ago #

    Thanks for the reply.

    It can be accomplished in WordPress® like this.

    <?php
    $user_id = "123";
    /* ^The User's ID. */
    $user = new WP_User($user_id);
    $user->add_cap("new_capability");
    ?>

    These examples may also help you.

    <?php
    $user->remove_cap("old_capability");
    print_r($user->allcaps); /* All Capabilities array. */
    ?>
  4. Vladimir Garagulya
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks for the good idea. I went through 'capabilities.php' and saw that it could store in the 'wp_usermeta' table not only role names but capabilities too. It will be good addition to the URE plugin functionality. I will try to realize that to the end of April.

  5. PriMoThemes
    Member
    Posted 3 years ago #

    Awesome.
    Where should I send my donation?
    Thank you!

  6. Vladimir Garagulya
    Member
    Plugin Author

    Posted 3 years ago #

    Please refer this page http://www.shinephp.com/donate/ and select a way to make a donation for URE plugin development.

  7. PriMoThemes
    Member
    Posted 3 years ago #

    Donation made. Hope it helps!
    ~ Thank you very much.

  8. Vladimir Garagulya
    Member
    Plugin Author

    Posted 3 years ago #

    I see your payment. Thanks. Work on the discussed update is started.

  9. Vladimir Garagulya
    Member
    Plugin Author

    Posted 3 years ago #

    I'm sorry for possible delay with delivering discussed update. I had short vacation at the end of April. I will build it these days.

  10. Vladimir Garagulya
    Member
    Plugin Author

    Posted 3 years ago #

    Hello,

    Interface to edit user's capabilities is ready for tests. You can download User Role Editor 3.1a from this link
    http://www.shinephp.com/wp-content/downloads/wordpress/plugins/user-role-editor-3.1a.zip
    Open users list. When you point mouse on the user name you will see the new link 'Capabilities'. Click on it to edit capabilities of selected user. You can change role assigned to the user there. Capabilities included to the role assigned to user are shown as disabled. Rest capabilities could be added directly to this user.
    Please take a look and let me know about your test results.

    Regards,
    Vladimir.

  11. PriMoThemes
    Member
    Posted 3 years ago #

    Oh, that's awesome!
    Thank you SO much. We're about to release the next version of s2Member, and I'll be sure to test this out soon thereafter and report back to you. Until then, thanks again!

  12. Ritsk
    Member
    Posted 2 years ago #

    hello,
    in my site drop down of user role shows one blank entry.
    I want to remove that So How can i remove that.

  13. Vladimir Garagulya
    Member
    Plugin Author

    Posted 2 years ago #

    Hello,
    Could you show screenshot with that dropdown list opened?

  14. Ritsk
    Member
    Posted 2 years ago #

    Thanks for the reply Vladimir Garagulya. It was due to plugin error. I removed the user role from database directly.

  15. Vladimir Garagulya
    Member
    Plugin Author

    Posted 2 years ago #

    If it is User Role Editor plugin error, can you reproduce it? It's useful to catch it in order to make the fix.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic