Super restricted entries is created to allow admin to restrict members or member groups to access entries. You can select whom you want to allow to see the entry in create/edit entries page. You can either allow specific members or member groups to access entries or leave that settings empty to allow everyone to access that entry. There is frontend tags to check access entry wise. You can also pass a parameter in exp:channel:entries loop to rid all entries from list that user not have access to view.
To get all the entries member is allowed to view, You can just pass a parameter in exp:channel:entries tag. (apply_super_restricted_entries=”yes”). Without adding this parameter, We will not search weather user is allowed to access entries comes with the channel loop or not. If you want to check all the entries in site for member access, You can either pass this parameter to each channel:entries tag or you can just set a config variable in “system > users > config > config.php” file. Variable is:
$config['apply_super_restricted_entries'] = 'y';
Same way if you want to enable all the relationships tags to show only member access entries, You can set a config variable:
$config['apply_super_restricted_entries_relationships'] = 'y';
In similar manner, If you have pass the config variable (that will remove all entries that user has no access to view from exp:channel:entries loop) and want to disable any exp:channel:entries loop to do that, You can do this by passing a same parameter in loop. (apply_super_restricted_entries=”no”)
{exp:channel:entries channel="blog" url_title="{last_segment}" require_entry="yes"}
{exp:super_restricted_entries:check entry_id="{entry_id}"}
{if super_restricted_entries:granted}
<p> <strong>Granted: </strong>{title}<br></p>
{/if}
{/exp:super_restricted_entries:check}
{/exp:channel:entries}
{exp:channel:entries channel="blog" url_title="{last_segment}" require_entry="yes"}
{exp:super_restricted_entries:check entry_id="{entry_id}"}
{if ! super_restricted_entries:granted}
{redirect="404"}
{/if}
{/exp:super_restricted_entries:check}
{/exp:channel:entries}
{exp:channel:entries channel="blog" dynamic="no"}
{exp:super_restricted_entries:check entry_id="{entry_id}"}
{if super_restricted_entries:granted}
<p> <strong>Granted: </strong>{title}<br></p>
{if:else}
<p> <strong>NOT Granted: </strong>{title}<br></p>
{/if}
{/exp:super_restricted_entries:check}
{/exp:channel:entries}
As described above, If you have not set config variable to search for each channel entries loop for member access and you want only entries that member has access to show, You have to pass a parameter like in given example below:
{exp:channel:entries channel="blog" dynamic="no" limit="10" apply_super_restricted_entries="yes"}
<p>{title}</p>
{paginate}{pagination_links}{/paginate}
{/exp:channel:entries}
If you have set a config variable and want all entries even if user is not allowed to view that, You have to pass the same parameter (with different value) like in given example below:
{exp:channel:entries channel="blog" dynamic="no" limit="10" apply_super_restricted_entries="no"}
<p>{title}</p>
{paginate}{pagination_links}{/paginate}
{/exp:channel:entries}
If you have not set a config variable to show only member access entries, You can do that by passing a parameter in channel:entries loop. (parameter not in relationships.)
{exp:channel:entries url_title="{last_segment}" apply_super_restricted_entries_relationships="yes"}
{relationships}
<p>{relationships:title}</p>
{/relationships}
{/exp:channel:entries}
Same way, If you have set a config variable and want all relationships entries, You can set that variable to “no”
{exp:channel:entries url_title="{last_segment}" apply_super_restricted_entries_relationships="no"}
{relationships}
<p>{relationships:title}</p>
{/relationships}
{/exp:channel:entries}
Version | 1.0.5 |
Last Update | 2 years ago |
Compatibility | EE 6, 5, 4, 3 |
License | Commercial |
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.