Closed (outdated)
Project:
Domain
Version:
7.x-3.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Feb 2012 at 01:56 UTC
Updated:
2 May 2025 at 12:53 UTC
Jump to comment: Most recent
Comments
Comment #1
agentrickardNo. That would require the File Access API to be completed first.
Comment #2
kapow99504 commentedOk, thanks, I thought I had missed something
Comment #3
agentrickardReference: #1227706: Add a file entity access API
Comment #4
mstrelan commentedFile entity access API was committed in October 2012.
Comment #5
agentrickardSo that suggests a Domain Files module. Anyone care to write it?
Comment #6
mstrelan commentedI'm working on a project that may require it, so I may be able to take a stab at it. Will probably need some guidance. Any idea off the top of your head what's required / where to start?
Comment #7
agentrickardIt would be a Domain Files module, and it needs the following elements (at the least).
* Data storage for the file access records. You could, perhaps, use Field API, though DA does not. If you don't use Field API, you need a {domain_file} table that stores your access information. Model it on {node_access}.
* A UI for selecting file access. Either a custom field or a FieldAPI field. Custom fields are easier to control, IMO.
* Implement hook_file_entity_access() for individual file actions.
* Implement hook_query_file_entity_access_alter() for file listings.
* Optional: a listing page for viewing files per domain.
Comment #8
mstrelan commentedI've started a sandbox project over at http://drupal.org/sandbox/mstrelan/1987490 which is working under the most basic conditions. Any feedback would be greatly appreciated.
TODO list
hook_query_file_entity_access_alter()for file listingsOther considerations
domain_form_alter()is relevant, didn't copy it all across. I suspect most of it is handling for edge cases which I'll eventually need.hook_file_entity_access()?Comment #9
agentrickardYou probably also need hook_field_extra_fields, assuming you don't use FieldAPI fields for data storage.
Comment #10
bluegeek9 commentedDrupal 7 in End of Life and no longer supported. We encourage you to upgrade to a supported version of Drupal. For more information, see https://www.drupal.org/upgrade.