0

認証されていないユーザーがホームページにアクセスしようとすると、空白のページが表示されます。

Global.asax.cs Appliaction_Error() でコードをデバッグすると、このエラーが発生しますThere is no action defined with the specified name "ViewLayout" for permission set "Controls"

私はそれを試しました:

 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();
 }

しかし、うまくいきませんでした。
ドキュメント:
https://docs.sitefinity.com/for-developers-crud-operations-with-permissions

4

0 に答える 0