PHPackages                             leaseweb/secure-controller-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. [Security](/categories/security)
4. /
5. leaseweb/secure-controller-bundle

ActiveSymfony-bundle[Security](/categories/security)

leaseweb/secure-controller-bundle
=================================

Provide '@Secure' annotation to secure actions in controllers by specifying required roles

v1.1.0(10y ago)14126.4k7[2 issues](https://github.com/LeaseWeb/LswSecureControllerBundle/issues)MITPHPPHP &gt;=5.3.2

Since Jun 8Pushed 10y ago22 watchersCompare

[ Source](https://github.com/LeaseWeb/LswSecureControllerBundle)[ Packagist](https://packagist.org/packages/leaseweb/secure-controller-bundle)[ Docs](http://www.leaseweblabs.com)[ RSS](/packages/leaseweb-secure-controller-bundle/feed)WikiDiscussions master Synced 1mo ago

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

LswSecureControllerBundle
=========================

[](#lswsecurecontrollerbundle)

Provide '@Secure' annotation to secure actions in controllers by specifying required roles.

NB: Instead of this bundle you may want to use the [@Security annotation](http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/security.html) provided by the SensioFrameworkExtraBundle (Symfony 2.4+ feature)

NB: This bundle was created because the [JMSSecurityExtraBundle](https://github.com/schmittjoh/JMSSecurityExtraBundle) is no longer provided in Symfony 2.3 (due to a license incompatibility) and this was the only feature we needed.

[![Build Status](https://camo.githubusercontent.com/4c6c0c243eb34b0ac5579811aecf538792cd73aa998a2b74b1feea274fd3fae5/68747470733a2f2f7472617669732d63692e6f72672f4c656173655765622f4c7377536563757265436f6e74726f6c6c657242756e646c652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/LeaseWeb/LswSecureControllerBundle)

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

[](#requirements)

- PHP 5.3
- Symfony 2.8

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

[](#installation)

Installation is broken down in the following steps:

1. Download LswSecureControllerBundle using composer
2. Enable the Bundle

### Step 1: Download LswSecureControllerBundle using composer

[](#step-1-download-lswsecurecontrollerbundle-using-composer)

Add LswSecureControllerBundle in your composer.json:

```
{
    "require": {
        "leaseweb/secure-controller-bundle": "*",
        ...
    }
}
```

Now tell composer to download the bundle by running the command:

```
$ php composer.phar update leaseweb/secure-controller-bundle
```

Composer will install the bundle to your project's `vendor/leaseweb` directory.

### Step 2: Enable the bundle

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

Enable the bundle in the kernel:

```
