Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This page aims at describing setting up a site which uses OG and needs public nodes with public files and private nodes with private files.
Requirements
- OG (7.x-1.x or later)
- Organic Groups
- Organic Groups access control
- File (Field) Paths (latest dev)
Adding the appropriate fields
- Add the Group Visibility field (group_content_access) to the content type (e.g. story)
- Set the Allowed values list to a private and public entry only
- Add a File field to the content type (e.g. story)
- Open the File (Field) Path Settings
- In the File path field, enter
[node:group_content_access]/[node:nid]
- Set Active updating
- Set the Upload destination to Private files
. This is necessary to move a file from public to private or back, when the visibility changes.
Setting up the file system
- Set the file system to private
- Create folders on your file system with the exact names used in the textual section of the Allowed values list
- In the private folder, if not already there: put an .htaccess file with only the line
SetHandler This_is_a_Drupal_security_line_do_not_remove Deny from all
.
Comments
7.x-2.x
Is there a 7.x-2.x solution to this problem?
[node:group_content_access] doesn't appear to be recognised
7.x-1.x or later
I have the same setup running on 7.x-2.x.
Is the module Organic Groups access control enabled?
Best regards,
Ed