質問

匿名ブログサブサイトを作成しました。私のルートサイトも匿名です。default.aspxに匿名でアクセスできますが、/lists/posts/post.aspx?id=1 ではありません。

許可の継承を破ることを試み、コメントリスト内のすべての匿名アクセスオプションをトグルしようとしました。これらのリストに移動すると、401の不正なエラーメッセージが表示されます。

私は何かが足りない?

役に立ちましたか?

解決

Below is the solution, however the issue of anonymous users being able to see draft items has cropped up...

SPList list = curWeb.Lists["Comments"];
// check if it has unique permissions
if (!list.HasUniqueRoleAssignments)
{
    list.BreakRoleInheritance(true);
}
// make sure people logged in can edit their own items
list.WriteSecurity = 2;
// turn on moderation
list.EnableModeration = true;
list.DraftVersionVisibility = DraftVisibilityType.Approver;
// grant permissions to anonymous users
list.AnonymousPermMask64 =
  (SPBasePermissions.Open |
   SPBasePermissions.OpenItems |
   SPBasePermissions.ViewFormPages |
   SPBasePermissions.ViewListItems |
   SPBasePermissions.AddListItems);
list.Update();
ライセンス: CC-BY-SA帰属
所属していません sharepoint.stackexchange
scroll top