Pull merge.
[yaffs-website] / web / modules / contrib / permissions_by_term / README.md
1 CONTENTS OF THIS FILE
2 ---------------------
3
4  * Introduction
5  * Requirements
6  * Recommended Modules
7  * Installation
8  * Configuration
9  * Testing
10  * Maintainers
11
12
13 INTRODUCTION
14 ------------
15
16 The Permissions by Term module extends Drupal by functionality for restricting
17 access to single nodes via taxonomy terms. Taxonomy term permissions can be
18 coupled to specific user accounts and/or user roles. Taxonomy terms are part of
19 the Drupal core functionality.
20
21 Since Permissions by Term is using Node Access Records, every other core system
22 will be restricted:
23  
24  * search
25  * menus
26  * views
27  * nodes
28
29  * For a full description of the module visit:
30    https://www.drupal.org/project/permissions_by_term
31    or
32    https://www.drupal.org/docs/8/modules/permissions-by-term
33
34  * To submit bug reports and feature suggestions, or to track changes visit:
35    https://www.drupal.org/project/issues/permissions_by_term
36
37
38 REQUIREMENTS
39 ------------
40
41 This module requires no modules outside of Drupal core.
42
43
44 RECOMMENDED MODULES
45 -------------------
46
47 Module ships with Permissions by Entity module that extends the functionality of
48 Permissions By Term to be able to limit the selection of specific taxonomy terms
49 by users or roles for an entity.
50
51 * Webform Permissions Term -
52   https://www.drupal.org/project/webform_permissions_by_term
53
54
55 INSTALLATION
56 ------------
57
58  * Install the Permissions by Term module as you would normally install a
59    contributed Drupal module. Visit https://www.drupal.org/node/1897420 for
60    further information.
61
62
63 CONFIGURATION
64 -------------
65
66     1. Navigate to Administration > Extend and enable the module.
67     2. Navigate to Administration > Structure > Taxonomy to create or edit a
68        taxonomy term and add permissions to it. You can edit permissions in the
69        "Permissions" labeled form field set.
70     3. Enter in allowed users with a comma separated list of user names will be
71        able to access content, related to this taxonomy term.
72     4. Select the user roles who will be able to access content, related to the
73        taxonomy term. Save.
74
75
76 TESTING
77 -------
78
79 Behat testing:
80
81  * composer.json config - Make sure that the dependencies for Behat testing are
82    installed. Check your drupal's `composer.json` file for the following
83    contents:
84    ```"require": {
85         "composer/installers": "^1.0.24",
86         "wikimedia/composer-merge-plugin": "~1.4",
87         "drupal/drupal-extension": "~3.0",
88         "guzzlehttp/guzzle" : "^6.0@dev",
89         "drupal/drupal-driver": "~1.0",
90         "behat/behat": "^3.1",
91         "behat/mink": "^1.7",
92         "behat/mink-extension": "^2.2",
93         "behat/mink-selenium2-driver": "^1.3",
94         "behat/mink-goutte-driver": "^1.2"
95     },
96
97     ...
98
99     "merge-plugin": {
100         "include": [
101             "core/composer.json",
102             "modules/permissions_by_term/composer.json"
103         ],
104         "recurse": false,
105         "replace": false,
106         "merge-extra": false
107     },
108
109     ...
110
111     "autoload": {
112         "psr-4": {
113             "Drupal\\Core\\Composer\\": "core/lib/Drupal/Core/Composer",
114             "Drupal\\Tests\\permissions_by_term\\Behat\\Context\\": "modules/permissions_by_term/tests/src/Behat/Context"
115         }
116     },
117     ```
118
119  * behat.yml file: Use the file at `tests/src/Behat/behat.yml.dist` as a
120    template for your needs. Copy and name it to `behat.yml` and change it's
121    paths according to your needs.
122
123  * Chromedriver: It is recommended to use the
124    [Chromedriver](https://sites.google.com/a/chromium.org/chromedriver/) as the
125    driver between your Google Chrome browser and Behat. Make sure, that the
126    Chromedriver version matches your operating system and your Google Chrome
127    browser version.
128
129  * Quick testing with a SQlite database: In
130    `permissions_by_term/tests/src/Behat/fixtures/db.sqlite` you can find a
131    SQLite database to test from. It is a standard Drupal 8 installation with PbT
132    module installed. That way each test run proceeds quicker, because it is one
133    file instead an entire relational database.
134
135 Make sure that the path to the SQLite database is contained in your
136 `settings.php` file. PbT awaits that the path is
137 `/sites/default/db.sqlite`. E.g.:
138 ``` $databases['default']['default'] = array (
139       'database' => '/Users/peter/Dev/mamp/permissions-by-term/sites/default/db.sqlite',
140       'prefix' => '',
141       'namespace' => 'Drupal\\Core\\Database\\Driver\\sqlite',
142       'driver' => 'sqlite',
143     );
144 ```
145
146 The database file location is fixed, because the DB gets wiped after each Behat
147 test suite run.
148
149
150 MAINTAINERS
151 -----------
152
153  * Peter Majmesku - https://www.drupal.org/u/peter-majmesku
154  * Janak Singh (dakku) - https://www.drupal.org/u/dakku
155
156 Supporting organiztion:
157
158  * publicplan GmbH - https://www.drupal.org/publicplan-gmbh