Skip to content

solutionDrive/SyliusAdminSecurityThroughObscurityPlugin

Repository files navigation

Sylius AdminSecurity Through Obscurity Plugin

This plugin does NOT provide any security!

It only hides specific menu points in the backend for defined set of roles. But if a person knows the urls the sites are still accessable.

To really manage access for some roles we recommend to have a look at Sylius Access Control Layer Plugin from bitbag

This plugin is for sylius

Configuration

Get a full list of configuration: bin/console config:dump-reference solution_drive_sylius_admin_security_through_obscurity

Example:

solution_drive_sylius_admin_security_through_obscurity:
    additional_admin_roles:
        - ROLE1
        - ROLE2
    hidden_menus:
        ROLE1:
            configuration: ~
        ROLE2:
            catalog:
              - products

Usage

Preparation

Prepare environment (we only need this once per environment)

  • test environment:

    $ composer install
    $ (cd tests/Application && yarn install)
    $ (cd tests/Application && yarn run gulp)
    $ (cd tests/Application && bin/console assets:install web -e test)
    
    $ (cd tests/Application && bin/console doctrine:database:create -e test)
    $ (cd tests/Application && bin/console doctrine:schema:create -e test) 
  • dev environment:

    $ composer install
    $ (cd tests/Application && yarn install)
    $ (cd tests/Application && yarn run gulp)
    $ (cd tests/Application && bin/console assets:install web -e dev)
    
    $ (cd tests/Application && bin/console doctrine:database:create -e dev)
    $ (cd tests/Application && bin/console doctrine:schema:create -e dev) 

Running plugin tests

  • PHPUnit

    $ bin/phpunit
  • PHPSpec

    $ bin/phpspec run
  • Behat (non-JS scenarios)

    $ bin/behat --tags="~@javascript"
  • Behat (JS scenarios)

    1. Download Chromedriver

    2. Run Selenium server with previously downloaded Chromedriver:

      $ bin/selenium-server-standalone -Dwebdriver.chrome.driver=chromedriver
    3. Run test application's webserver on localhost:8080:

      $ (cd tests/Application && bin/console server:run 127.0.0.1:8080 -d web -e test)
    4. Run Behat:

      $ bin/behat --tags="@javascript"

Opening Sylius with your plugin

  • Using test environment:

    $ (cd tests/Application && bin/console sylius:fixtures:load -e test)
    $ (cd tests/Application && bin/console server:run -d public -e test)
  • Using dev environment:

    $ (cd tests/Application && bin/console sylius:fixtures:load -e dev)
    $ (cd tests/Application && bin/console server:run -d public -e dev)

About

This plugin does NOT provide any security

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published