Does anybody know if it's possible to create a context aware Data Type? What I'd like is to create a Member Picker control that filters itself based upong the permissions within that section of the site. ie
Members Bob Bill Barry
Tree Home - Section < Only Bob and Bill have access - Page 1 < This page has a Member Picker Data Type on only showing Bob and Bill
This is what I see happening in the source code of the Protectpage.aspx, it loops over all Roles and then checks if the role is allowed for the document. You can use that also I think, just use the following line to check if the document is protected by a certain role
Creating a context aware Member Picker Data Type
Hi Guys,
Does anybody know if it's possible to create a context aware Data Type? What I'd like is to create a Member Picker control that filters itself based upong the permissions within that section of the site. ie
Members
Bob
Bill
Barry
Tree
Home
- Section < Only Bob and Bill have access
- Page 1 < This page has a Member Picker Data Type on only showing Bob and Bill
Matt
This is what I see happening in the source code of the Protectpage.aspx, it loops over all Roles and then checks if the role is allowed for the document. You can use that also I think, just use the following line to check if the document is protected by a certain role
Access.IsProtectedByMembershipRole(int.Parse(helper.Request("id")), role)
When you have all the selected roles use Roles.GetUsersInRole("Your RoleName") to get the users assigned to that role.
Below the source code in Umbraco, hope the formattings stays okay after submit
Cheers,
Richard
Sweet, that should do the trick =)
Matt
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.