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 All;
I have searched for hours and not found the answer to this, so was hoping someone here could help.
How do I get the roles set on a node from code behind?
I have my node: Node nodeToCheck = new Node(nodeID);
How do I now know what role permissions are set on this node?
Thanks in advance.
I am using aspnet membership if it makes any difference?!
I just found out how to do this, so thought I would report back here:
string[] roles = Access.GetAccessingMembershipRoles(int.Parse(nodeID), nodeToCheck.Path);
or simpler if you do not want to manually check the roles assigned you can check against the membershipuser
bool hasAccess = Access.HasAccess(int.Parse(nodeID), nodeToCheck.Path, MembershipHelper.GetCurrentUser());
Did you use Umbraco 4.6.1? as in mine is always returning null.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Umbraco Node Permission from Code Behind
Hi All;
I have searched for hours and not found the answer to this, so was hoping someone here could help.
How do I get the roles set on a node from code behind?
I have my node: Node nodeToCheck = new Node(nodeID);
How do I now know what role permissions are set on this node?
Thanks in advance.
I am using aspnet membership if it makes any difference?!
I just found out how to do this, so thought I would report back here:
or simpler if you do not want to manually check the roles assigned you can check against the membershipuser
Did you use Umbraco 4.6.1? as in mine is always returning null.
is working on a reply...