DB Rules
Security rules from a database
CBSecurity also allows you to store your security rules in a database as long as all the columns match the keys of the rules as we saw in the rule anatomy.
You will use the db as the source and fill out the available db properties:
// CB Security
cbSecurity : {
firewall : {
rules : {
provider : {
"source" : "db",
"properties" : {
"dsn" : "myapp",
"sql" : "",
"table" : "securityRules",
"orderBy" : "order asc"
}
}
}
}
}The
dsnproperty is the name of the datasource to useThe
tableproperty is what table the rules are stored inThe
orderByproperty is what order by SQL to use, by default it is emptyThe
sqlproperty is what SQL to execute to retrieve the rules. The default isselect * from ${table}
Last updated
Was this helpful?