0

To add a taxonomy-Column to a List I try to add a new TermSet in the default Termstore. This is the code:

TermStore termStore = session.GetDefaultSiteCollectionTermStore();
clientContext.Load(termStore);
TermSetCollection termSets = termStore.GetTermSetsByName(TermSetName, lcid);
clientContext.Load(termSets);
clientContext.ExecuteQuery();
if (termSets==null || termSets.Count==0)
{
var termGroup = termStore.GetTermGroupByName(TaxonomyGroup);
if (termGroup == null)
{
termGroup = termStore.CreateTermGroup(TaxonomyGroup);
}
termSetId = Guid.NewGuid();
TermSet termSetColl = termGroup.CreateTermSet(TermSetName, termSetId, lcid);
}

On CreateTermGroup() I receive a "Permission denied" error for my Add-In.

I already added write-Permissions to the taxonomy in my manifest:

  <AppPermissionRequests AllowAppOnlyPolicy="true">
    <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web/list" Right="FullControl" />
    <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web" Right="FullControl" />
    <AppPermissionRequest Scope="http://sharepoint/taxonomy" Right="Write"     />
    <AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" />
  </AppPermissionRequests>

What additional permission do I need?

1 Answer 1

0

Found a solution myself: It does not seem to be possible to create a new Group using CSOM. Nonetheless: This is not neccessary to create a new taxonomy. Instead the default Group of the sitecollection can be used:

termGroup=termStore.GetSiteCollectionGroup(siteCollection, true);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.