In my latest WordPress project, the client wanted a user with the capabilities of a Contributor but they also wanted them to be able to upload files. This is where the problem arose, a Contributor can't upload files! I could upgrade them to an Author, which would allow them to upload files but in turn would allow them to publish posts too.
I'd used role manager plugins before (such as Role Scoper) and they seemed way to clunky and heavy for what I wanted, besides I only wanted to modify the property of one role ever so slightly.
So I did some digging and found this handy bit of code. In your plugins folder, create a file called edit_roles.php and add in the following code.
Activate the plugin through the Dashboard and voila, a Contributor will now be able to upload files.
Add more capabilities
Adding other capabilities is simple too, copy line 19 and change the argument in
add_cap('argument') to one of the roles from this table.
$edit_contributor->add_cap('publish_pages'); $edit_contributor->add_cap('switch_themes'); // and so on