Memflex
Memflex copied to clipboard
Question: Using Attributes with roles (Answered)
Should stuff like this work? [Authorize(Roles="UberAdmin,AccountAdmin,LicenseAdmin")]
I can't get it to work, and I am wondering if it should work before I dig deeper.
The built-n authoize attributes doesn't look at memflex since memfle doesn't plug into the traditional asp.net role provider stuff. You'd have to write a custom filter (see LogMeIn\filters\FlexAuthorizeAttribute.cs).
Note that sample assumes an IFlexRoleProvider can be property injected into the filter, which the LogMeIn sample is setup to do using StructureMap, so you'd either need a custom dependency resolver or hard code the role provider.
Hope that makes sense,
Excellent, I was hoping I had only missed something simple.
Thanks!
On 23 April 2013 14:28, K. Scott Allen [email protected] wrote:
The built-n authoize attributes doesn't look at memflex since memfle doesn't plug into the traditional asp.net role provider stuff. You'd have to write a custom filter (see LogMeIn\filters\FlexAuthorizeAttribute.cs).
Note that sample assumes an IFlexRoleProvider can be property injected into the filter, which the LogMeIn sample is setup to do using StructureMap, so you'd either need a custom dependency resolver or hard code the role provider.
Hope that makes sense,
— Reply to this email directly or view it on GitHubhttps://github.com/OdeToCode/Memflex/issues/31#issuecomment-16854951 .