ACL (Access Control Lists), namely Access Rights

Note: this was introduced with Pages 0.21

To keep things simple for now, we had added cache: false in the frontmatter. This turns of caching for the page (Pages is build for caching anonymous requests at the moment, caching authenticated requests isn't fine-tuned yet..

Only visible for hasRole or hasGroup

Please note that all Roles and Groups should be all lowercase when you code with Pages at the moment (in the future you can use whatever).

Following text 'blabla' is only visible for hasRole 'special'

Following text 'blabla' is only visible for hasGroup 'registered'

Following text 'blabla' is only visible for hasGroup 'super users'

Following text 'blabla' is only visible for hasGroup 'registered' OR 'super users'

Following text 'blabla' is only visible for hasGroup 'registered' AND 'super users'

    <h3>Only visible for hasRole or hasGroup</h3>

<p>Please note that all Roles and Groups should be <i>all lowercase</i> when you code with Pages at the moment (in the future you can use whatever).</p>

<h4>Following text 'blabla' is only visible for hasRole <samp>'special'</samp></h4>
<? if(user()->hasRole('special')) : ?>
   <p>blabla</p>
<?  endif ?>

<h4>Following text 'blabla' is only visible for hasGroup <samp>'registered'</samp></h4>
<? if(user()->hasGroup('registered')) : ?>
   <p>blabla</p>
<?  endif ?>

<h4>Following text 'blabla' is only visible for hasGroup <samp>'super users'</samp></h4>
<? if(user()->hasGroup('super users')) : ?>
   <p>blabla</p>
<?  endif ?>

<h4>Following text 'blabla' is only visible for hasGroup <samp>'registered' OR 'super users'</samp></h4>
<? if(user()->hasGroup(['registered', 'super users'])) : ?>
   <p>blabla</p>
<?  endif ?>

<h4>Following text 'blabla' is only visible for hasGroup <samp>'registered' AND 'super users'</samp></h4>
<? if(user()->hasGroup(['registered', 'super users'], true)) : ?>
   <p>blabla</p>
<?  endif ?>