Download the PHP package effective-solutions/security-bundle without Composer
On this page you can find all versions of the php package effective-solutions/security-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download effective-solutions/security-bundle
More information about effective-solutions/security-bundle
Files in effective-solutions/security-bundle
Package security-bundle
Short Description Effective Solutions (Pvt) Ltd. Security Bundle
License MIT
Homepage http://effectivesolutions.lk/
Informations about the package security-bundle
Effective Solutions - Security Bundle
Installation
Use following command in command line to install Effective Solutions Security Bundle
php composer.phar require effective-solutions/security-bundle
After the installation add following in your AppKernel.php
file
new EffectiveSolutions\SecurityBundle\EffectiveSolutionsSecurityBundle(),
Add following in app/config/routing.yml
file
Usage
-
Create
User.php
file in your Entity folder and add following code. -
Create
Role.php
file in your Entity folder and add following code. - Run following code to create your user and role tables in your database
php app/console doctrine:schema:update --force
-
Add following code in your
security.yml
file - Run following code in your command line to configure admin user. Admin username is admin and password is admin
php app/console register
- Then go to
http://localhost/YourAppName/web/app_dev.php/login
With Sonata Admin Bundle
If you are using Sonata Admin Bundle
, create BaseAdmin class and extend your admin classes from BaseAdmin class.
Overide isGranted
method in the BaseAdmin class as follows.
Create roles_access_config.yml
in your app/config folder and you can write access control logic in that. For example,
If you want to secure a controller, you can write route alias as above and call secure()
in the Controller or isSecure()
to check if the user has permission to access that controller.
Thank you for using Effective Solutions Security Bundle. Powered By EffectiveSolutions.lk