Security update for permissions_by_term
[yaffs-website] / web / modules / contrib / permissions_by_term / README.md
1 Permissions by Term
2 ====================================
3
4 Visit [Pbt's documentation page on Drupal.org](https://www.drupal.org/docs/8/modules/permissions-by-term) to
5 learn how to use this module.
6
7 ## Modules which extend PbT's functionality
8 - [Webform Permissions By Term](https://www.drupal.org/project/webform_permissions_by_term)
9 This modules will be merged into PbT soon.
10 - [Permissions by Entity](https://www.drupal.org/project/permissions_by_entity)
11 This module is now merged into PbT
12
13 ## Behat testing
14
15 ### composer.json config
16 Make sure that the dependencies the PbT module are installed. Check your drupal's `composer.json` file
17 for the following contents:
18
19     "require": {
20         "composer/installers": "^1.0.24",
21         "wikimedia/composer-merge-plugin": "~1.4"
22     },
23     
24     ...
25     
26     "merge-plugin": {
27         "include": [
28             "core/composer.json",
29             "modules/permissions_by_term/composer.json"
30         ],
31         "recurse": false,
32         "replace": false,
33         "merge-extra": false
34     },
35     
36     ...
37     
38     "autoload": {
39         "psr-4": {
40             "Drupal\\Core\\Composer\\": "core/lib/Drupal/Core/Composer",
41             "Drupal\\Tests\\permissions_by_term\\Behat\\Context\\": "modules/permissions_by_term/tests/src/Behat/Context"
42         }
43     },
44     
45 ### behat.yml file
46 Use the file at `tests/src/Behat/behat.yml.dist` as a template for your needs. Copy and name it to `behat.yml` and change
47 it's paths according to your needs.
48     
49 ### Chromedriver
50 It is recommended to use the [Chromedriver](https://sites.google.com/a/chromium.org/chromedriver/) as the driver between
51 your Google Chrome browser and Behat. Make sure, that the Chromedriver version matches your operating system and your
52 Google Chrome browser version.
53
54 ### Quick testing with a SQlite database
55 In permissions_by_term/tests/src/Behat/fixtures/db.sqlite` you can find a SQLite database to test from. It is a standard
56 Drupal 8 installation with PbT module installed. That way each test run proceeds quicker, because it is 1 file
57 instead an entire relational database.
58
59 Make sure that the path to the SQLite database is contained in your `settings.php` file. PbT awaits that the path is
60 `/sites/default/db.sqlite`. E.g.:
61
62     $databases['default']['default'] = array (
63       'database' => '/Users/peter/Dev/mamp/permissions-by-term/sites/default/db.sqlite',
64       'prefix' => '',
65       'namespace' => 'Drupal\\Core\\Database\\Driver\\sqlite',
66       'driver' => 'sqlite',
67     );
68
69 The database file location is fixed, because the DB gets wiped after each Behat test suite run.