RoleAssignments.GetAssignmentByPrincipal(siteGroup) Error
- From: Amit <Amit@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 28 Jul 2008 03:58:02 -0700
Hi,
I am using following code snippet
foreach (SPGroup group in itemWeb.Groups)
{
siteGroup = group;
SPSecurity.CodeToRunElevated
elevatedCodeForAssignment = new
SPSecurity.CodeToRunElevated(GetRoleAssignments);
SPSecurity.RunWithElevatedPrivileges(elevatedCodeForAssignment);
}
void GetRoleAssignments()
{
SPRoleAssignment assignment =
currentWeb.RoleAssignments.GetAssignmentByPrincipal(siteGroup);
}
This code works correctly when Site Collection admin is logged in,but
crashes with "Access Denied" whenever visitor is logged in.
Anyone having any idea how to get this code executed.
I am already running the code with elevated permissions.
Regards,
Amit
.
- Prev by Date: Splist internals
- Next by Date: Re: CAS syntax in manifest for Full trust (creating Sharepoint WSP)
- Previous by thread: Splist internals
- Next by thread: Css Overriding code in TreeView?
- Index(es):