PHPackages                             linkorb/userbase-role-provider-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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. linkorb/userbase-role-provider-bundle

ActiveSymfony-bundle[Authentication &amp; Authorization](/categories/authentication)

linkorb/userbase-role-provider-bundle
=====================================

Userbase Role Provider Bundle for modern Symfony Applications

v4.0.0(3y ago)0473MITPHPPHP &gt;=8.0.3

Since Jul 1Pushed 3y agoCompare

[ Source](https://github.com/linkorb/userbase-role-provider-bundle)[ Packagist](https://packagist.org/packages/linkorb/userbase-role-provider-bundle)[ RSS](/packages/linkorb-userbase-role-provider-bundle/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (6)Versions (9)Used By (0)

Userbase Role Provider Bundle

Use this bundle to add Roles to Users loaded by the UserProvider.

Userbase does not provide Role information about its users so apps need to supply their own. This bundle allows you to define fixed roles for your users and these will be incorporated into the User objects loaded by the Userbase UserProvider.

Define the fixed roles in a Yaml file at `config/roles.yaml`:-

```
my-username: [ROLE_ADMIN]
some-other-username: [ROLE_USER]
```

Next, clear the app cache so that the roles are baked into the service container configuration. And that's it! You can now restrict access to resources based on these roles.

The bundle will load roles from the roles.yaml file without any further configuration. It can instead be made to load roles from the environment. Populating a service parameter named `userbase.roles` is the key to this alternative configuration:

```
# add to a .env file
USERBASE_ROLES='{"adele":["ROLE_ADMIN"]}'

# add to config/services.yaml
parameters:
  userbase.roles: '%env(json:USERBASE_ROLES)%'

# add to config/packages/userbase.yaml
userbase_role_provider:
  fixed_roles:
    from_files: false

```

The change to userbase.yaml will require that the app cache is cleared. Then the roles will be loaded from the `USERBASE_ROLES` environment variable at the start of every request.

Installation
============

[](#installation)

Note: this feature requires version 1.7 or later of the userbase/client package. You may need to begin installation by issuing:-

```
$ composer require "linkorb/userbase-client ^1.7"
```

Applications that use Symfony Flex
----------------------------------

[](#applications-that-use-symfony-flex)

Open a command console, enter your project directory and execute:

```
$ composer require linkorb/userbase-role-provider-bundle
```

Applications that don't use Symfony Flex
----------------------------------------

[](#applications-that-dont-use-symfony-flex)

### Step 1: Download the Bundle

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
$ composer require linkorb/userbase-role-provider-bundle
```

This command requires you to have Composer installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

### Step 2: Enable the Bundle

[](#step-2-enable-the-bundle)

Then, enable the bundle by adding it to the list of registered bundles in the `config/bundles.php` file of your project:

```
// config/bundles.php

return [
    // ...
    LinkORB\Userbase\RoleProvider\UserbaseRoleProviderBundle::class => ['all' => true],
];
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity70

Established project with proven stability

 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 ~170 days

Recently: every ~228 days

Total

8

Last Release

1365d ago

Major Versions

v1.0.1 → v2.0.02020-02-20

v2.1.0 → v3.0.02021-07-28

v3.2.0 → v4.0.02022-10-04

PHP version history (2 changes)v3.2.0PHP \*

v4.0.0PHP &gt;=8.0.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/19f8d602132a01fd1e79793c91e73aed64ea31f65748096e4120904169027779?d=identicon)[boite](/maintainers/boite)

---

Top Contributors

[![boite](https://avatars.githubusercontent.com/u/989892?v=4)](https://github.com/boite "boite (13 commits)")

### Embed Badge

![Health badge](/badges/linkorb-userbase-role-provider-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/linkorb-userbase-role-provider-bundle/health.svg)](https://phpackages.com/packages/linkorb-userbase-role-provider-bundle)
```

PHPackages © 2026

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