Forum Discussion
Set branch based on AD company Value
I'm looking at setting up policy where if the company value is Company A they branch off to one set of resources and if company B they go to a different set of resources.
I've found a variable assign rule
session.custom.company.role if { ( [mcget {session.ad.last.attr.company}] equals "Company A" )} or equal "Company B"
This is set in the properties section but if I want to set 2 different branches for each company how do we alter the rule to do this?
Thanks
Chris
3 Replies
- Stanislas_Piro2
Cumulonimbus
You must define 2 branches with expressions:
-
branch Company A
expr {[mcget {session.ad.last.attr.company}] equals "Company A" } -
branch Company B
expr {[mcget {session.ad.last.attr.company}] equals "Company B" }
-
- Chris_Richards_
Nimbostratus
Thanks for the response.
I take it I need to leave the session.custom.company.role if { ( [mcget {session.ad.last.attr.company}] equals "Company A" )} or equal "Company B" In the variable assign properties section? When I leave it blank it complains
- Stanislas_Piro2
Cumulonimbus
I don't understand why you need to assign value to session.custom.company.role!!!
if you need it, the expression is:
session.custom.company.role = if { ( [mcget {session.ad.last.attr.company}] equals "Company A" ) || ( [mcget {session.ad.last.attr.company}] equals "Company B" )} { return "value of the role" } else { return "other value of the role" }or of you want to assign a different role for every company:
session.custom.company.role = if { ( [mcget {session.ad.last.attr.company}] equals "Company A" )} { return roleA } elseif { ( [mcget {session.ad.last.attr.company}] equals "Company B" )} { return roleB } else { return "other value of the role" }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com