The MU forums have moved to WordPress.org

Removing add author/editor/administrator Capabilities Globally (6 posts)

  1. Xandria
    Member
    Posted 16 years ago #

    Here's an interesting situation. I confess I've no clue how to write this so if there's a plugin that will do this, please let me know. If there is no plugin, then I'll happily consider paying someone to write this (although theoretically, it shouldn't be too much trouble... maybe??) :-)

    I've set up MU. At the moment any user can add another user to their blog and give them author/editor/admin etc. privileges. Is there a way to turn this feature off globally and be able to selectively GIVE it to a user.

    Thanks so much for your time and input.

    Cheers.

  2. jalien
    Member
    Posted 16 years ago #

    Just some thoughts off the top of my head.

    Users can be allowed (disallowed) to create users, usually higher level users have this enabled, but you could edit your user defaults so that admins have it and editors don't.

    the Role Manager plugin allows this, but doesn't seem to fully work with WPMU. It even allows the creation of new user categories. It is being kept up to date again for regular WP, so if you wanted to tackle getting it working for WPMU, there would be some grateful users.

    The following is at the top of the user.php file:
    if ( !current_user_can('edit_users') )
    Another way to cheat this would be to use Premium Blogs plugin and edit this to allow premium blogs to edit users.

  3. sadieko
    Member
    Posted 16 years ago #

    Thanks for the suggestion, Jalien. We've got Premium Blogs installed right now (I'm working with Xandria on this project).

    I'm not entirely sure, though, how to edit it to grant edit-users access to the Premium Blogs, while ALSO automatically denying access to everyone else. Any ideas?

  4. dsader
    Member
    Posted 16 years ago #

    Limiting any plugin to a certain theme can be done by placing the code from the plugin into the theme's function.php(if none, make one). Then managing access to the themes via the SiteAdmin-->Blogs-->Edit.

    Or if using userthemes, copy function into the usertheme's funtion.php in the blogs.gir/###/themes folder.

    Finally, would something like the following work as an mu-plugin to hide the user-edit fields for all blogs:

    <?php
    function hide_add_user () {
    	echo "
    	<style type=\"text/css\">
    	.wrap {
    	display: none;
    	}
    	</style>
    	";
    }
    if (strpos($_SERVER['REQUEST_URI'], 'users.php'))
    {
    add_action('admin_head', 'hide_add_user');
    }
    ?>

    and then make a normal plugin such as

    <?php
    function show_add_user () {
    	echo "
    	<style type=\"text/css\">
    	.wrap {
    	display: block !important;
    	}
    	</style>
    	";
    }
    if (strpos($_SERVER['REQUEST_URI'], 'users.php'))
    {
    add_action('admin_head', 'show_add_user');
    }
    ?>

    Manage access to the second plugin as a premium plugin.

  5. dsader
    Member
    Posted 16 years ago #

    BTW the add or edit users functions are still there and will work if the enduser can figure out how to do it with out seeing a thing in their browser.

  6. Xandria
    Member
    Posted 16 years ago #

    Thank you thank you!!!!

About this Topic