PHPackages                             perspeqtive/sulu-permission-aware-templates-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. perspeqtive/sulu-permission-aware-templates-bundle

ActiveSulu-bundle[Templating &amp; Views](/categories/templating)

perspeqtive/sulu-permission-aware-templates-bundle
==================================================

Adds permissions to templates

3.0.2(1mo ago)3106↓42.9%proprietaryPHPPHP ^8.2

Since Jan 20Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/perspeqtive/sulu-permission-aware-templates-bundle)[ Packagist](https://packagist.org/packages/perspeqtive/sulu-permission-aware-templates-bundle)[ RSS](/packages/perspeqtive-sulu-permission-aware-templates-bundle/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (6)Dependencies (6)Versions (8)Used By (0)

Sulu Permission Aware Templates Bundle
======================================

[](#sulu-permission-aware-templates-bundle)

[![Latest Stable Version](https://camo.githubusercontent.com/516820445ae05cc58dc5aab2f6ca4904ff77781de2158279314380822348a497/68747470733a2f2f706f7365722e707567782e6f72672f70657273706571746976652f73756c752d7065726d697373696f6e2d61776172652d74656d706c617465732d62756e646c652f762f737461626c65)](https://packagist.org/packages/perspeqtive/sulu-permission-aware-templates-bundle)

This bundle adds permission-aware page templates to the Sulu admin.

It registers a security context for every available Sulu page template and uses these permissions to restrict the template dropdown and the page toolbar actions. This makes it possible to decide per role which templates can be selected, changed, saved, published, unpublished, or deleted.

✨ Features
----------

[](#-features)

- Adds a dedicated Sulu security context for page templates.
- Restricts the page template dropdown to templates the current user is allowed to use.
- Keeps the currently selected template visible, even if the user is not allowed to switch to another one.
- Disables save, publish and unpublish actions when the current template is not writable for the current user.
- Disables delete actions when the current template is not deletable for the current user.
- Supports toolbar actions inside Sulu dropdown toolbar actions.

📋 Requirements
--------------

[](#-requirements)

- PHP 8.2 or higher
- Sulu 2.6 or higher

⚙️ Installation
---------------

[](#️-installation)

### Install the bundle via composer:

[](#install-the-bundle-via-composer)

```
composer require perspeqtive/sulu-permission-aware-templates-bundle
```

### Enable the bundle

[](#enable-the-bundle)

If your application does not use Symfony Flex, register the bundle manually:

```
// config/bundles.php

return [
    // ...
    PERSPEQTIVE\SuluPermissionAwareTemplatesBundle\SuluPermissionAwareTemplatesBundle::class => ['all' => true],
];
```

### Add the bundle to package.json

[](#add-the-bundle-to-packagejson)

In order to enable visibility- and disabled-checks for toolbar actions, you need to register the bundle in your package.json:

```
// assets/admin/package.json
{
    // ...
    "dependencies":
    {
        // ...
        "sulu-permission-aware-templates-bundle": "file:../../vendor/perspeqtive/sulu-permission-aware-templates-bundle/assets/js"
    }
},
```

### Import the bundle

[](#import-the-bundle)

```
// assets/admin/app.js

// ...
import 'sulu-permission-aware-templates-bundle';
```

### Rebuild the admin JS

[](#rebuild-the-admin-js)

```
cd assets/admin
npm install
npm run build
```

### Clear the cache

[](#clear-the-cache)

Clear the cache after installing the bundle:

```
bin/console cache:clear
```

🔐 Permissions
-------------

[](#-permissions)

After installation, Sulu contains a new `Templates` security section. Every page template is registered with its own security context:

```
Sulu
`-- Templates
    |-- templates.default
    |-- templates.homepage
    `-- templates.article

```

The permission behavior is:

PermissionBehavior`add`The user may edit a content page that already uses the template, but cannot change the template.`write`The user may select the template in the dropdown and may change an existing page to this template. The user may also save, publish and unpublish pages using this template.`delete`The user may delete a content page that uses this template.⚠️ **Important**: Users without the required template permission can still edit content pages they are allowed to access, but the template-related actions are restricted by the permissions above.

Internally the bundle maps these checks to Sulu's template security permissions:

Sulu permissionUsed for`add`Template dropdown availability`edit`Save, publish and unpublish toolbar actions`delete`Delete toolbar action⚠️ **Important**: After changing the permissions, you need to clear the browser cache (F5) for the changes to take effect.

🧩 Usage
-------

[](#-usage)

No additional configuration is required. The bundle reads the available page templates from Sulu's `page` form metadata and registers matching security contexts automatically.

Assign the permissions in the Sulu role settings:

1. Open the Sulu admin.
2. Go to `Settings` &gt; `Roles`.
3. Select a role.
4. Configure the permissions in `Sulu` &gt; `Templates`.
5. Save the role.

The page editor then applies the permissions automatically:

- Users without `write` permission only see templates they may keep or select.
- Users with access to a page may still edit the page content.
- Users without `write` permission for the current template cannot save, publish or unpublish that page.
- Users without `delete` permission for the current template cannot delete that page.

⚠️ **Important**: After changing the permissions, you need to clear the browser cache (F5) for the changes to take effect.

🤝 Contribution
--------------

[](#-contribution)

Please feel free to fork and extend existing or add new features and send a pull request with your changes. To establish a consistent code quality, please provide unit tests for all your changes and adapt the documentation.

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance90

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~35 days

Recently: every ~0 days

Total

6

Last Release

48d ago

Major Versions

1.0.0 → 2.0.02026-07-13

2.0.0 → 3.0.02026-07-13

2.0.1 → 3.0.22026-07-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/d9ff41f18aa954874ee2602115e6a623bdc317e6562b036e77271923650632f6?d=identicon)[MarkusHolstein](/maintainers/MarkusHolstein)

---

Top Contributors

[![MarkusHolstein](https://avatars.githubusercontent.com/u/191744183?v=4)](https://github.com/MarkusHolstein "MarkusHolstein (27 commits)")

---

Tags

templateaclpermissionssulu

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/perspeqtive-sulu-permission-aware-templates-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/perspeqtive-sulu-permission-aware-templates-bundle/health.svg)](https://phpackages.com/packages/perspeqtive-sulu-permission-aware-templates-bundle)
```

###  Alternatives

[phpoffice/phpword

PHPWord - A pure PHP library for reading and writing word processing documents (OOXML, ODF, RTF, HTML, PDF)

7.6k42.7M272](/packages/phpoffice-phpword)[rize/uri-template

PHP URI Template (RFC 6570) supports both expansion &amp; extraction

435158.4M74](/packages/rize-uri-template)[sulu/skeleton

Project template for starting your new project based on the Sulu content management system

29736.5k](/packages/sulu-skeleton)[perspeqtive/sulu-snippet-manager-bundle

Transform snippets in custom managers

101.7k](/packages/perspeqtive-sulu-snippet-manager-bundle)[larablocks/pigeon

A more flexible email message builder for Laravel 5 including chained methods, reusable message configurations, and message layout and template view management.

143.7k](/packages/larablocks-pigeon)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
