Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi!
I am trying to use the MemberAuthorize to devide verified and unverified members. I can't figure out what I am doing wrong though.
I am using the following line:
[Umbraco.Web.WebApi.MemberAuthorize(AllowGroup = "Active")]
But anyone is able to acces the method, also if you haven't logged in yet. I double checked if I added the member to the group correctly with:
var usersInRole = System.Web.Security.Roles.FindUsersInRole("Active", "%");
And it is definitely in there.
I have also noticed that doing this:
[Umbraco.Web.WebApi.MemberAuthorize]
Doesn't require you to login like this
[Authorize]
does. What is the proper way of using it?
Or have some of the previous issues returned? http://issues.umbraco.org/issue/U4-2759#tab=Comments
Is anyone else having trouble with any of the Umbraco Authorize options? None of them seem to work for me.
Ended up doing it this way:
[Authorize] public ActionResult MethodA() { Member currentMember = Member.GetCurrentMember(); var memberIsActivated = System.Web.Security.Roles.IsUserInRole(currentMember.Email, "Active"); if (memberIsActivated){ //regular code } else { return PartialView("_ActivationPage"); }}
As the umbraco method above appears to be broken.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
MemberAuthorize AllowGroup
Hi!
I am trying to use the MemberAuthorize to devide verified and unverified members. I can't figure out what I am doing wrong though.
I am using the following line:
But anyone is able to acces the method, also if you haven't logged in yet. I double checked if I added the member to the group correctly with:
And it is definitely in there.
I have also noticed that doing this:
Doesn't require you to login like this
does. What is the proper way of using it?
Or have some of the previous issues returned? http://issues.umbraco.org/issue/U4-2759#tab=Comments
Is anyone else having trouble with any of the Umbraco Authorize options? None of them seem to work for me.
Ended up doing it this way:
As the umbraco method above appears to be broken.
is working on a reply...