freelock/composer-group-permissions

Composer plugin to ensure group write permissions for installed packages

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:composer-plugin

pkg:composer/freelock/composer-group-permissions

v1.0.0 2025-08-24 18:01 UTC

This package is not auto-updated.

Last update: 2026-01-13 16:06:21 UTC


README

Latest Stable Version License

A Composer plugin that automatically ensures group write permissions for all installed packages by temporarily setting umask to 0002 during install/update operations.

Problem

When using Composer in shared hosting environments or team development setups, newly created files often lack group write permissions (644 instead of 664), causing permission issues that require manual fixing.

Solution

This plugin automatically:

  • Sets umask to 0002 before composer install and composer update commands
  • Restores the original umask after operations complete
  • Ensures all vendor files have group write permissions (664/775)

Installation

Global Installation (Recommended)

Install globally to affect all projects:

composer global require freelock/composer-group-permissions

Per-Project Installation

composer require freelock/composer-group-permissions

Usage

Once installed, the plugin works automatically. You'll see verbose output when running composer with -v:

composer install -v
# [Group Permissions Plugin] Set umask to 0002 (was 0022)
# ... composer operations ...
# [Group Permissions Plugin] Restored umask to 0022

How It Works

The plugin hooks into Composer's event system:

  • pre-install-cmd / pre-update-cmd: Sets umask to 0002
  • post-install-cmd / post-update-cmd: Restores original umask

This ensures all files created during composer operations have group write permissions without affecting the rest of your system.

Requirements

  • PHP 7.4 or higher
  • Composer 2.0 or higher

Use Cases

  • Shared hosting: Multiple users need write access to vendor files
  • Team development: Developers sharing code on the same server
  • Deployment scripts: Ensuring web server can write to vendor directories
  • Docker containers: Maintaining proper permissions across user boundaries

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Created by Freelock LLC to solve permission issues in shared Drupal and WordPress hosting environments.