Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've installed WordPress for my school's website.

I have a task of creating a file archive, an uploader and a file viewer for the website. The file archive would store files on the server, "in the background". The uploader would enable users to upload files and tag them. And a file viewer would allow users to view and download files as per their tags.

Both the uploader and the viewer would have to be integrated into the page. If there is a plugin that does something like this, but displays its results in the admin panel - that would be acceptable as well. But it would have to be intuitive and easy to use.

All registered users of the site should be able to view and download the files. And only the ones with a specific file upload privilege should be able to upload them.

I'm not sure whether what I want can be accomplished with the built-in media archive. I don't only want to upload media - but other file types such as documents, programs, etc.

Is there a plugin that would enable registered users to upload files without using the admin panel, but just the site itself? All the download links to the files have to be included automatically in the Downloads page too.

Some form of a file manager would be great.

share|improve this question
add comment

migrated from webapps.stackexchange.com Apr 20 '13 at 12:15

This question came from our site for power users of web applications.

1 Answer

up vote 1 down vote accepted

These are actually two questions. The second question – how to add categories to attachments – is already answered.

How to restrict uploading attachment to a specific role?

The capability to do that is named upload_files in WordPress. Some roles have this capability by default: authors, editors, administrators.

I would restrict it to editors and administrators. You can use a run-once plugin for that:

<?php
/* Plugin Name: Change Roles */

add_action( 'admin_notices', 't5_change_roles', 0 );

// Fires on the plugin activation screen just once.
function t5_change_roles()
{
    global $wp_roles;

    if ( ! isset( $wp_roles ) )
        $wp_roles = new WP_Roles;

    $existing_roles = get_editable_roles();

    foreach ( $existing_roles as $name => $role )
    {
        if ( 'administrator' === $name )
            continue;

        if ( 'editor' === $name )
            continue;

        $wp_roles->remove_cap( $name, 'upload_files' );
    }

    // Suppress "Plugin activated" notice.
    unset( $_GET['activate'] );

    print '<div class="updated"><p>Roles are updated, plugin deactivated.</p></div>';
}

But you can also use a plugin like Members and edit the roles per user interface:

enter image description here

share|improve this answer
    
Hi, thanks for your answer, but please see the updated question. –  akled May 2 '13 at 18:11
    
@Yannbane Sorry, plugin/theme recommendations are off topic here. Please never change the meaning of a question after there are answers. –  toscho May 2 '13 at 18:13
    
I'm sorry, it's not that I've tried to change the meaning, it's just that I've had trouble actually articulating the question originally. But yeah, I realize what you're saying, sorry again. –  akled May 2 '13 at 18:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.