I am trying to set the Authorize for my controllers can do the following:
[Authorize(Roles = "Approver")]
How ever the names of the roles are held in the database, and therefore I would like to try and do the following:
[Authorize(Roles = Settings.Instance.RoleEmployee)]
but I get the following error:
An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type
Any way around this?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With