Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Using Attributes with roles (Answered) #31

Open
rickardliljeberg opened this issue Apr 23, 2013 · 2 comments
Open

Question: Using Attributes with roles (Answered) #31

rickardliljeberg opened this issue Apr 23, 2013 · 2 comments

Comments

@rickardliljeberg
Copy link
Contributor

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.

@OdeToCode
Copy link
Owner

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,

@rickardliljeberg
Copy link
Contributor Author

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//issues/31#issuecomment-16854951
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants