No worries! Of course I’ll explain it thoroughly to you. If there is any terminology I mention that you don’t understand make sure to let me know.
Simply put, role based redirects mean:
-
A user signs up to your identity gateway or is invited by your through the UI.
-
They are assigned role(s) - for example
admin
oreditor
-
Then what we can do is limit specific pages in our site to a specific role or multiple roles even.
So lets say that we want users with the role of admin
to access the admin
page in our site. This is how we would go about it:
In our netlify.toml file in the root of our site we can use a boilerplate like this:
[[redirects]]
from = "/admin/*"
force = true
status = 200
conditions = {Role = ["admin"]}
[[redirects]]
from = "/admin/*"
to = "/"
force = true
status = 302
This specific rule tells Netlify to only allow users with the roles of admin
to access the page admin
or any of its sub pages.
Kyle.