memberpoint/wos-permissions-bundle

There is no license information available for the latest version (v4.09) of this package.

Installs: 24

Dependents: 17

Suggesters: 0

Type:symfony-bundle

v4.09 2021-12-01 05:44 UTC

README

The MemberPoint Whole-Of-Sports (WOS) PermissionsBundle provides functionality for the management of roles and permissions.

For instructions on how to use the bundle, refer to the bundle's documentation.

Installation

These instructions assume the consuming application uses Symfony Flex.

Add the following repository to the application's composer.json file:

"repositories": [
    {
        "type": "composer",
        "url": "https://code.int.savagebull.com.au"
    }
]

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

$ composer require memberpoint/wos-permissions-bundle

Post-Installation

This section describes post-installation steps required for the bundle to work correctly. Steps are divided into the following sections:

Persistence

This bundle relies on Doctrine for persistence. After installing this bundle, ensure a connection to a database is correctly configured before executing:

$ php bin/console doctrine:schema:update --force

Routes

This bundle defines a collection of routes that serve as JSON API-endpoints. If the consuming application wishes to expose these endpoints, be sure to import them into the application's routing configuration:

# config/routes.yaml
wos_permissions_api:
  resource: PermissionsBundleProxy
  prefix: /api

Unit Testing

Ensure the bundle has all development dependencies available, then open a command console, enter the project directory, and execute:

$ vendor/bin/phpunit --testdox --coverage-text

Integration Testing

The PermissionsBundle provides fixtures for loading "fake" sets of data into a database to help perform integration testing.

Ensure the Fixtures bundle and the Faker library are available to the testing application:

$ composer require --dev doctrine/doctrine-fixtures-bundle
$ composer require --dev fzaninotto/faker

Then execute the following to load the fixtures:

$ php bin/console doctrine:fixtures:load

Development controller

In addition to fixtures, the PermissionsBundle provides a development controller with methods to help with integration testing. The development controller is only available in the 'dev' and 'test' environments, and to make the controller accessible, its routes must be imported:

# config/routes/dev/wos_permissions.yaml
memberpoint_wos_permissions:
  resource: '@WOSPermissionsBundle/Resources/config/dev/routing.yaml'
  prefix: /_wos_permissions

Among the methods provided by the development controller is the ability to set an object as the current session user. For more information about the devlopment controller methods, refer to the controller directly.