Opened 2 years ago

Closed 2 years ago

#21380 closed New feature (fixed)

There is no easy way to set permission to directories in collecting static files

Reported by: vajrasky Owned by: vajrasky
Component: contrib.staticfiles Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


This is the continuation of ticket #21219. Right now, the files will get permissions from FILE_UPLOAD_PERMISSIONS (unless you subclass the static files storage class and set file_permissions) in collecting static files, but not directories. Directories will not get permission from FILE_UPLOAD_DIRECTORY_PERMISSIONS (or FILE_UPLOAD_FILE_PERMISSIONS).

I suggest that we add feature where the directories in collecting static files will get permission be default from FILE_UPLOAD_DIRECTORY_PERMISSIONS (unless we subclass the static file storage class and set directory_permissions attributes).

Change History (3)

comment:1 Changed 2 years ago by timo

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 2 years ago by vajrasky

  • Has patch set
  • Owner changed from nobody to vajrasky
  • Status changed from new to assigned

This is the PR for this ticket:

comment:3 Changed 2 years ago by Tim Graham <timograham@…>

  • Resolution set to fixed
  • Status changed from assigned to closed

In 7e2d61a9724644d6d1c7ce9361d9fd5be3e2ab86:

Fixed #21380 -- Added a way to set different permission for static directories.

Previously when collecting static files, the directories would receive permissions
from the global umask. Now the default permission comes from FILE_UPLOAD_DIRECTORY_PERMISSIONS
and there's an option to specify the permissions by subclassing any of the
static files storage classes and setting the directory_permissions_mode parameter.

Note: See TracTickets for help on using tickets.
Back to Top