Skip to content

Commit e74cb26

Browse files
authored
Update README.md to reflect 1.0.1
1 parent 9ff127a commit e74cb26

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

README.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,51 @@ fields:
6161
```php
6262
return [
6363
'sylvainjule.bouncer.list' => [
64-
'test' => 'canaccess'
64+
'test' => [
65+
'fieldname' => 'canaccess'
66+
]
67+
]
68+
];
69+
```
70+
71+
### 2.1 Optional page switcher
72+
73+
(beta)
74+
75+
Since 1.0.1 a given user can access different pages. You can remove the `multiple: false` option from the blueprint:
76+
77+
```yaml
78+
# User role blueprint
79+
title: Test
80+
81+
fields:
82+
canaccess:
83+
label: 'The user will only be able to access:'
84+
type: pages
85+
options: query
86+
query: site.pages # or any query that suits your needs
87+
```
88+
89+
Add a `bouncernav` section in every page you'd like to display the language switcher on:
90+
91+
```php
92+
// Anywhere in any blueprint
93+
94+
(...)
95+
sections:
96+
bouncernav:
97+
type: bouncernav
98+
```
99+
100+
Then state in your `config.php` that you want to display the page switcher for a given user role:
101+
102+
```php
103+
return [
104+
'sylvainjule.bouncer.list' => [
105+
'test' => [
106+
'fieldname' => 'canaccess',
107+
'nav' => true
108+
]
65109
]
66110
];
67111
```

0 commit comments

Comments
 (0)