When I try to access my home page with an unauthenticated user I am receiving a blank page.
If I debug the code in the Global.asax.cs Appliaction_Error() I am receiving this error There is no action defined with the specified name "ViewLayout" for permission set "Controls"
.
I've tried that:
Guid everyOneRoleId = new Guid("86ae86b4-7617-4ab3-bc30-b98aaabf68cc");
Permission permission = pageManager.GetPermission(
SecurityConstants.Sets.LayoutElement.View,
pageManager.GetSecurityRoot(false).Id,
everyOneRoleId );
if (pa == null)
{
pa = pageManager.CreatePermission(
SecurityConstants.Sets.LayoutElement.View,
pageManager.GetSecurityRoot(false).Id,
everyOneRoleId );
pageManager.GetSecurityRoot(false).Permissions.Add(permission);
pageManager.SaveChanges();
}
But it didn't worked.
Documentation:
https://docs.sitefinity.com/for-developers-crud-operations-with-permissions