I would like to ask to someone who knows how to load AddAuthorizationRules from a table of customes roles in a database.
I still use CSLA 3.8.4 i a realy need to load the AuthorizationRules from a database. I a newbie and I don´t know how to do it, i google in the CSLA Forum but no luke.
Can someone give me an example please.
Thanks in advance.
I can think of two alternatives:
1: Get roles from database and add as parameter to Authz rules, using the built-in Csla authz rules:
In your BO AddAuthorizationRules you should use a CommandObject or ReadOnly object to load the rule info from the database and then add Authz rules with roles from database unsing the built-in roles based authz rules.
2. Create a generic Authz rule that uses a cache of roles from database (load on app startup?)
You must avoid frequent data access - so prefer on application startup or when adding type authz rules (executed just once per type).
See also some older posts:
Thansk you for yours help.
I´ve done the first solution you have point to me and it´s working well, It was not so dificullt at all.
Thanks you again.
Copyright (c) Marimer LLC