Changing the default form url removes permissions
-
25-12-2020 - |
문제
I want to change the default forms for lists with CSOM C#, which is already working fine:
using (var ctx = new ClientContext(url))
{
ctx.Credentials = new SharePointOnlineCredentials(Username, Password);
List spList = ctx.Web.Lists.GetByTitle(list);
ctx.Load(spList);
ctx.ExecuteQuery();
spList.DefaultEditFormUrl = "_forms/EditForm2.aspx";
var group = ctx.Web.AssociatedOwnerGroup;
ctx.Load(group);
ctx.ExecuteQuery();
spList.AddPermissionLevelToGroup(group.Title, RoleType.Administrator);
}
However, even if I add permissions to the owner group, I can't manage to access the edit form after setting the new one this way
해결책
I found out what was the issue, it's not that permissions were removed from setting the URL, but that my user did not have permissions to access _forms/EditForm2.aspx.
If the file is instead located in Lists/list2/EditForm2.aspx, everything works just fine.
제휴하지 않습니다 sharepoint.stackexchange