Search:  

Previous pageSite security - users and permissions Next page
Using redirection to first-child as a permission switch 

This is an advanced technique that allows you to give people one common address to browse to, but which results in them ending up viewing different pages depending on which usergroup they are in.

In the example below we will construct a switch which is the equvalent of saying:

"If the user is in group A then show page X otherwise show page Y" 

To create the switch:

  • Add a Section (we'll call it 'switch' but the name is not important)
  • Underneath 'switch', add two Pages (X and Y). X should appear first, above Y in the tree. The order is significant.
  • Set the permissions for page X to deny usergroup A to view the page, and deny the Visitor usergroup
  • Set the permissions for page Y to allow usergroup A to view the page, and deny the Visitor usergroup
  • Back in the parent 'switch' section, set Settings / Options / "Redirect to First Child" to Yes

Now, when a user browses to the 'switch' secion, they will be redirected to the first child component in that section. However, the site takes them to the first child that they have permission to view, so, depending on the usergroup they are in, this will be page X or page Y

Redirecting to different sections

In many situations, you will not actually want the user to remain on a page with the 'switch' page as a parent, but need them to be elsewhere on the site. To do this, simply add page Redirects to page X and Y that redirect out to the desired locations.

More than two options

You can have more than two options. Be sure to sequence them so that the page with the most restrictive permissions is listed first.

 

 

Site security - users and permissions