PHPackages                             thelia/customer-group-acl-module - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. thelia/customer-group-acl-module

ActiveThelia-module[Authentication &amp; Authorization](/categories/authentication)

thelia/customer-group-acl-module
================================

0.3.0(3mo ago)05384LGPL-3.0+PHP

Since Apr 24Pushed 3mo ago8 watchersCompare

[ Source](https://github.com/thelia-modules/CustomerGroupAcl)[ Packagist](https://packagist.org/packages/thelia/customer-group-acl-module)[ RSS](/packages/thelia-customer-group-acl-module/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (2)Versions (10)Used By (0)

CustomerGroupAcl
================

[](#customergroupacl)

Extends the CustomerGroup module with an access control list mechanism that can be used to allow or deny access to some resource to a customer group.

Installation
------------

[](#installation)

### Manually

[](#manually)

- Copy the module into `/local/modules/` directory and make sure that the name of the module is CustomerGroupAcl.
- Activate it in your Thelia administration panel

### Composer

[](#composer)

Add it in your main Thelia composer.json file

```
composer require thelia/customer-group-acl-module:~0.1

```

\## Update

### 0.1.3

[](#013)

- Change acl data table to add class\_name, the class name to check specific object acl ;
- Dispatch `CheckAclEvent_[resource]` ;
- Change checkAcl definition to checkAcl($resources, $accesses, $accessOr = false, $entityId = null, $dispatchEvent = false) :
    - $entityId, object identifying, if isset resources must be alone,
    - $dispatchEvent, if is set, CheckAclEvent are dispatch, default false ;

Execute `setup/update-0.1.2-0.1.3.sql` script.

Configuration
-------------

[](#configuration)

### Using the configuration file

[](#using-the-configuration-file)

Modules that use customer group ACLs must define them in the `acl.xml` file in the module configuration directory. The ACLs will be created when the module is activated.

Since ACLs are applied to customer group, you must have already have created some in order to use them (see the CustomerGroup module documentation). In this exemple, we will assume that the `client`, `vip`, `also-vip-1` and `also-vip-2` groups exists.

```

                  VIP perks
                  Special VIP perks.

                  Avantages VIP
                  Avantages spéciaux VIP.

```

Here we define an ACL resource `vip-perks` and grant `VIEW` type access to this resource to the `vip` group. The `extra-vip-1` group is set to have the same accesses as the `vip` group. The `extra-vip-2` group is also set to have the same rights as the `vip` group, but only for the `vip-perks` ACL resource.

### Using the back office

[](#using-the-back-office)

ACLs and group accesses can also be configured in the Thelia back office. A link to the configuration page is available in the **Tools** menu.

### Access types

[](#access-types)

The available access types are defined in the Thelia access manager:

- `VIEW`
- `CREATE`
- `UPDATE`
- `DELETE`

Additionally, the `ALL` access can be used to grant all available accesses.

Check group access
------------------

[](#check-group-access)

### PHP

[](#php)

The `customer_group_acl.tool` can be used to check ACL access.

```
$aclTool = $container->get("customer_group_acl.tool");

// simple check
$aclTool->checkAcl("vip-perks", AccessManager::VIEW);

// resources and accesess arguments can be a single value or an array of values
$aclTool->checkAcl(
    [
        "myAcl1",
        "myAcl2",
    ],
    [
        AccessManager::VIEW,
        AccessManager::CREATE,
    ]
);

// by default, checks that at all accesses are granted
// but you can also check that only at least one access is granted
$aclTool->checkAcl(
    "myAcl",
    [
        AccessManager::VIEW,
        AccessManager::CREATE,
    ],
    true
);
```

### Smarty

[](#smarty)

Smarty plugins are provided to check ACL access in templates.

As with the PHP function, you can check multiple resources and accesses at once, and optionally require only one access.

#### Simple check

[](#simple-check)

The `check_acl` function will throw an exception if the required access(es) are not granted.

```
{check_acl code='vip-perks' access='view'}

{check_acl code='vip-perks,myAcl' access='view,create'}

{check_acl code='myAcl' access='view,create,update' access_or=true}
```

#### Block check

[](#block-check)

The `acl` and `elseacl` tags can also be used to check ACL accesses with a block syntax.

```
{acl name='acl-check' code='vip-perks' access='view'}
    Here is some super secret stuff !
{/acl}

{elseacl rel='acl-check'}
   Get VIP access for more cool stuff !
{/elseacl}
```

Loop
----

[](#loop)

### acl

[](#acl)

This loop list ACLs.

#### Input arguments

[](#input-arguments)

ArgumentDescription**id**Id or list of ACL ids.**module**Id or list of module ids.**code**Code or list of ACL codes.**order**Order of the results.**lang**Locale of the results.**order** can be one of:

- `id` (default)
- `module`
- `module_reverse`

#### Output arguments

[](#output-arguments)

VariableDescription$ACL\_IDACL id.$MODULE\_IDId of the module defining the ACL.$CODEACL code.$TITLEACL title in the selected locale.$DESCRIPTIONACL description in the selected locale.### customer-group-acl

[](#customer-group-acl)

This loop list customer group access grants.

#### Input arguments

[](#input-arguments-1)

ArgumentDescription**acl**Id or list of ACL ids.**customer\_group**Id or list of customer group ids.**acl\_type**Access type or list of access types.**activate**Whether to only list active access grants (`true`) or not (`false`) or both (`*`).#### Output arguments

[](#output-arguments-1)

VariableDescription$ACL\_IDACL id.$CUSTOMER\_GROUP\_IDCustomer group id.$TYPEAccess type.$ACTIVATEWhether the access grant is active.

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance78

Regular maintenance activity

Popularity15

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.1% 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 ~560 days

Recently: every ~958 days

Total

8

Last Release

119d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2196919?v=4)[thelia](/maintainers/thelia)[@thelia](https://github.com/thelia)

---

Top Contributors

[![bcbrr](https://avatars.githubusercontent.com/u/4911969?v=4)](https://github.com/bcbrr "bcbrr (8 commits)")[![Doud-dgros](https://avatars.githubusercontent.com/u/140515418?v=4)](https://github.com/Doud-dgros "Doud-dgros (3 commits)")[![bilhackmac](https://avatars.githubusercontent.com/u/3740078?v=4)](https://github.com/bilhackmac "bilhackmac (1 commits)")[![doekia](https://avatars.githubusercontent.com/u/1429488?v=4)](https://github.com/doekia "doekia (1 commits)")[![MaximeMorille](https://avatars.githubusercontent.com/u/819533?v=4)](https://github.com/MaximeMorille "MaximeMorille (1 commits)")

### Embed Badge

![Health badge](/badges/thelia-customer-group-acl-module/health.svg)

```
[![Health](https://phpackages.com/badges/thelia-customer-group-acl-module/health.svg)](https://phpackages.com/packages/thelia-customer-group-acl-module)
```

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[beatswitch/lock

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)[amocrm/amocrm-api-library

amoCRM API Client

182728.5k6](/packages/amocrm-amocrm-api-library)[vonage/jwt

A standalone package for creating JWTs for Vonage APIs

424.1M4](/packages/vonage-jwt)

PHPackages © 2026

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