I am trying to install Authorize for my controllers, can do the following:
[Authorize(Roles = "Approver")]
Be that as it may, role names are stored in the database, so I would like to try to do the following:
[Authorize(Roles = Settings.Instance.RoleEmployee)]
but I get the following error:
The attribute argument must be a constant expression, typeof expression, or an array creation expression type attribute attribute
How to get around this?
source
share