PHPackages                             atompulse/ran-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. atompulse/ran-bundle

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

atompulse/ran-bundle
====================

Atompulse RanBundle

v1.1.4(8y ago)1750Apache-2.0PHP

Since Oct 17Pushed 8y ago1 watchersCompare

[ Source](https://github.com/atompulse/ran-bundle)[ Packagist](https://packagist.org/packages/atompulse/ran-bundle)[ RSS](/packages/atompulse-ran-bundle/feed)WikiDiscussions master Synced 1mo ago

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

Resources
---------

[](#resources)

[![SensioLabsInsight](https://camo.githubusercontent.com/c459b2484d815ccff2dc27bf6b30de78f571ef8fa6fd42bce25a3bd4008a1c27/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f63616434653963342d333665362d346539322d613937392d3633386133663461303862312f6269672e706e67)](https://insight.sensiolabs.com/projects/cad4e9c4-36e6-4e92-a979-638a3f4a08b1)

- [Contributing](https://symfony.com/doc/current/contributing/index.html)
- [Report issues](https://github.com/atompulse/atompulse/issues) and [send Pull Requests](https://github.com/atompulse/atompulse/pulls)in the [main Atompulse repository](https://github.com/atompulse/atompulse)

What is RanBundle?
------------------

[](#what-is-ranbundle)

- enables symfony applications to implement a straight forward mechanism in authorizing access based on permissions.
- the Ran bundle is a simple authorization system that can be used for creating simple 2 level hierarchies of authorization:
    - Authorization Group
        - Group Action 1 Authorization
        - Group Action 2 Authorization
        - Group Action N Authorization
- the authorization system is managed by simply adding options to your routes and grouping routes into authorization groups thus creating a 2 level system.

In addition the bundle provides the mechanism to build a simple 2 level customizable menu system fully integrated with the authorization system, thus eliminating the need to use a separate system for managing the menu in an application (or to have the menu hardcoded into templates).

The Ran bundle does not provide a security system for authentication BUT can be used with any custom made or 3rd party bundle(FosUserBundle) since symfony decouples authentication and authorization. It is recommended to use RanBundle along with FosUserBundle since it already has a nice API to manage users and groups, also it has all common db wrappers (doctrine, propel, mongo, etc) used in symfony apps.

Requirements
------------

[](#requirements)

```
- PHP 7.1.*
- symfony 3.*

```

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

[](#installation)

1. Summary:

    - install using composer
    - enable the Bundle
    - configure the RanBundle
2. In details:

    - `composer require atompulse/ran-bundle` OR add `"atompulse/ran-bundle": "*"` directly in your composer file
    - add the bundle to your kernel `AppKernel.php` -&gt; `new Atompulse\Bundle\RanBundle\RanBundle()`
    - check the bundle 'config' folder for configuration details &amp; add them to your config.yml (see documentation section for more details)

Documentation
-------------

[](#documentation)

1. How it works

    - routes are decorated with an option to have a specific authorization name and an authorization group
    - a command is executed `ap:ran:build` to generate the yml files that will be used for building the authorization hierarchy
    - from the generated yml files you create manually the menu system (menu tree) and the authorization module system (what you present to the user)
    - using a simple UI you allow the system admins to manage USER groups and authorization to these USER groups BY using the Authorization Groups
    - in the controllers all actions (routes that you decorated with the options) will be automatically checked for authorization
    - in templates you can easily check for authorization using the `is_granted` function `{% if is_granted('AUTHORIZATION_NAME') %}`
2. Configuration

    - use the yml configs from the bundle's config folder as a template for your config.yml

    - this is the folder where the bundle will generate the required yml files based on your routing.yml

        generator: output: "%kernel.root\_dir%/../src/bundles/VendorName/AppBundle/Resources/config/ran"
    - source folder for the menu configuration

        menu: source: "%kernel.root\_dir%/../src/bundles/VendorName/AppBundle/Resources/config/ran/menu.yml" param: main\_menu session: application.menu
    - source folder for the UI tree configuration

        ui\_tree: source: "%kernel.root\_dir%/../src/bundles/VendorName/AppBundle/Resources/config/ran/ui\_tree.yml" param: ran\_ui\_tree
    - security override - special roles which will override the RAN authorization system

        security: override: \[ROLE\_SUPER\_ADMIN\]
    - menu: check the bundle's config folder for menu.yml as a template for your own menu and to easily understand the content
    - `menu->param` since `menu.yml` is a resource file it needs a parameter entry key that can be referenced
    - `menu->session` this will be an entry in the session that will contain the full menu structure personalized for a user after he has authenticated; just after the user has authenticated(onSecurityInteractiveLogin) the content of `menu.yml` is read and items are removed where the current user does not have authorization; this data can be accessed and used directly to display the menu in the templates (since the content is already filtered there's no need to check for authorization) `{% set menuItems = app.session.get('application.menu') %}`
    - ui\_tree: check the bundle's config folder for ran\_ui\_tree.yml as a template for your own UI tree and to easily understand the content
    - `ui_tree->param` since `ui_tree.yml` is a resource file it needs a parameter entry key that can be referenced
    - in this file we organize the authorization groups into collections (super groups) to easily manage the presentation on the UI
    - security override: this is a mechanism to allow exceptions(overrides) to the authorization IF the developers encounter some special cases
3. Securing actions

    - Check the bundle's config folder for routing.yml to see examples on how to add ran options for routes and thus create authorization names
4. Checking for authorization (permissions)

    - in controllers the authorization for an action that has been integrated is checked automatically so you dont have to check manually for authorization
    - in templates use `is_granted` function (twig) `{% if is_granted('AUTHORIZATION_NAME') %}` to simply check for a specific action authorization OR an entire authorization group
5. UI integration

    - it is recommend to use the FosUserBundle to manage the users/groups
    - the UI tree can be integrated using JS libraries like dynatree () or iVantage Treeview module (for angularjs) or any other library that can build a tree structure out of json data
    - the system provides a controller trait `RanManagementTrait` that can be used in your controller to process the input/output from the UI and store the authorization data into FosUserBundle tables

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

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

Recently: every ~5 days

Total

6

Last Release

3009d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/098a1249bc0874b3b11eecebf40d5b830e92cd64c93650a6b39daa871d492e89?d=identicon)[atompulse](/maintainers/atompulse)

---

Top Contributors

[![atompulse](https://avatars.githubusercontent.com/u/6084843?v=4)](https://github.com/atompulse "atompulse (15 commits)")

### Embed Badge

![Health badge](/badges/atompulse-ran-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/atompulse-ran-bundle/health.svg)](https://phpackages.com/packages/atompulse-ran-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k12.4M193](/packages/simplesamlphp-simplesamlphp)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[nelmio/api-doc-bundle

Generates documentation for your REST API from attributes

2.3k63.6M233](/packages/nelmio-api-doc-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)

PHPackages © 2026

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