Hello everyone,

I'm a bit new to Drupal, but I've done quite a bit of hobbyist stuff in HTML/CSS/JavaScript/PHP over the last 10 years, so I have a relatively good understanding of basic web development. I'm now working on my first serious project, and I've decided that Drupal seems like the best platform to build it with. I'm looking for some assistance on one aspect of how I can go about doing something that I don't believe is built into Drupal by default. I'm attempting to create a private groups-based file browser. The files will be uploaded by the administrator, and users of various groups will have access to files intended specifically for them.

Visual example:

_ Group A _
| User 1, User 2, User 3 |
+Directory
-+ File 1
-+ File 2

_ Group B _
| User 4, User 5, User 6 |
+Directory
-+ File 3
-+ File 4

In this example, members of Group A would have access to files 1 and 2, while members of Group B would have access to files 3 and 4. So far, to accomplish this goal, I created a content type named File with a file field, that way I can manage the individual files as a nodes. To create the folder hierarchy, I did some digging and came across someone's explaination of how to accomplish it with taxonomy, that article can be read here. Lastly, and here is where my problem lies, I searched for a way to group users so that only members who belong to Group A can see the files assigned to Group A, and no one else's. More digging led me to the Groups module, which seemed capable of doing this. I also saw Organic Groups, but it hasn't been ported to Drupal 8 yet, so I haven't touched it as of yet. After looking through the settings the Groups module provides, it seems each group is only capable of creating Page and Article content types that are group specific. The group-specific content types are managed as plugins, and I cannot find a plugin that will let me add my custom "File" content type to the group.

At this point, I cannot find any other modules that are similar in function to Groups (except for Organic Groups which I haven't used since it hasn't been ported yet). If anyone has any articles or guides relating to making specific nodes only available to specific groups of users, or if anyone has an idea on a way to do this, I'd really like to read or hear about it, respectively. If anyone knows if the OG module has this functionality, I would be willing to use Drupal 7 instead.. but since 8 is the newer version, I'd prefer to use it unless it's absolutely not possible. Any help or advice at all is appreciated. Thanks!

Best regards,
Nicolai Skye

Edit: I neglected to mention another important factor. Each file that is uploaded will have specific (searchable) characteristics. These fields will be in addition to the native fields that are attached (such as date created, author, etc). As an example, if the file uploaded is a school document, it might have the fields "Class:," "Completed on:," or "Due By:." The fields will be universal across the whole site, so specific groups do not need specific fields. I believe I can use the built-in Views module to display my File content type nodes along with the various characteristics of that node (Title, File Name, Completed on, etc). I'm open to suggestions other than using Views, but the alternative will need to be able to have the ability to add more details to a plain file.

Comments

Anonymous’s picture

If you set groups by roles, you can use IMCE for D7 or D8: https://www.drupal.org/project/imce

Feature:
- Configurable limits for user roles: file size per upload, directory quota, file extensions, and image dimensions
...

or take a look at: https://www.drupal.org/project/filedepot but that is only D7

NicolaiSkye’s picture

Thanks for the quick reply!

I had realized I left something important out of my original message. It's been edited to better reflect what I'm aiming to accomplish.

I came across both IMCE and Filedepot in my searches over the past couple of weeks that I've been trying to complete this project. I'm not entirely sure, however, if either one of them can accomplish my goals. I am expecting a lot of different groups to be necessary (A, B, C, D, .. to Z and beyond), so I'm not sure if managing them as user roles will be manageable. Also, I do not see an ability in IMCE to add additional characteristics (like Title, Name, Phone Number, etc) to files - but please correct me if I'm wrong. Thanks again for your assistance, though!

Anonymous’s picture

Both these modules (IMCE or File depot) will not allow additional fields to be added.

I think you should try groups as you said: https://www.drupal.org/project/group

And perhaps see if this will fit into your requirement for managing documents: https://www.drupal.org/project/media_entity

This means, you'll need to experiment on Drupal 8

NicolaiSkye’s picture

Thanks.

I'll take a look at the Media Entity module. As I mentioned originally, I'm currently trying to use Groups - as it would be most convenient .. but for some reason it only allows a group to have a group-specific Page or Article content type. If Media Entity adds some kind of plugin or functionality to Groups to allow it to possess other content types, then my problem will be solved. I'll come back here and update on whether it works or not after I've tried it.

Anonymous’s picture

Actually, i don't think media entity will have any means to manage permissions settings on it as you will be adding it as a field to a content type and expose it to use for the specific content type.

I still think, you should go down the route of roles and manage your set of users that way, and use IMCE (with private file system so files cannot be accessed publicity).

Groups module is for creating sections of the site that you want certain group of users to access and maintain.