Skip to content

Using NetBrothers Access Control Center in Symfony projects.

Notifications You must be signed in to change notification settings

netbrothers-gmbh/syncacc-bundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NetBrothers SyncAcc for Symfony

This is a symfony bundle for using NetBrothers Access Control Center (ACC).

The ACC offers you a way to handle permissions based on roles and routes. This bundle communicates with your ACC-instance and synchronizes your defined permissions into your project.

Installation

Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.

Applications that use Symfony Flex

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

composer require netbrothers-gmbh/version-bundle

Applications that don't use Symfony Flex

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 netbrothers-gmbh/version-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 [
    // ...
    NetBrothers\VersionBundle\NetBrothersVersionBundle::class => ['all' => true],
];

Setup

You have to set up the bundle:

  1. Copy installation/config/packages/netbrothers_syncacc.yaml to symfony's config path.

  2. Set the credentials either in .env-file or netbrothers_syncacc.yaml:

.env netbrothers_syncacc.yaml Description
ACC_ENABLE acc_enable enable acc
ACC_SERVER acc_server Url ACC-Server
ACC_SOFTWARE_TOKEN acc_software_token SoftwareToken
ACC_SERVER_TOKEN acc_server_token Server-Token
ACC_USE_BASIC_AUTH acc_use_basic_auth enable Authentication Basic-Auth
ACC_BASIC_AUTH_USER acc_basic_auth_user Username Basic-Auth
ACC_BASIC_AUTH_PASSWORD acc_basic_auth_password Password Basic-Auth
  1. Clear symfony's cache.

  2. Create tables by migration.

Usage

  1. Open a command console, enter your project directory and execute the following command:
php bin/console netbrothers:acc 

You can specify some options:

option meaning
all (default) get roles and acl
roles get roles
acl get acls

CAUTION: Option acl only works, if table acl_role is filled.

Author

Stefan Wessel, NetBrothers GmbH

nb.logo

Licence

MIT