Hi all,
I'm working with the SP.Taxonomy.js in order to retrieve the terms under a specific TermSet under a TermGroup.
Here you can see a snippet from my client code:
var clientContext = new SP.ClientContext.get_current();
var session = SP.Taxonomy.TaxonomySession.getTaxonomySession(clientContext);
var termStores = session.get_termStores();
var termStore = termStores.getByName('TermStoreName');
var termGroup = termStore.get_groups().getByName('TermGroupName');
var termSet = termGroup.get_termSets().getByName(termId);
// Get all the terms
var termColl = termSet.get_terms();
clientContext.load(termColl);
clientContext.executeQueryAsync(function () {doStuff();});
It work well for most users but when this page is visited by a user with Read permission the code above doesn't work.
In particular there is an error during the retrieving of the TaxonomySession object using the clientContext. this error don't allow me to execute the intialization of the all required objects to retrieve the list of terms from the termset.
Is it allowed to access the TaxonomySession with a Read profile? Should I use the SP.Service instead to retrieve the managed metadata?
Thanks
Leo
I'm working with the SP.Taxonomy.js in order to retrieve the terms under a specific TermSet under a TermGroup.
Here you can see a snippet from my client code:
var clientContext = new SP.ClientContext.get_current();
var session = SP.Taxonomy.TaxonomySession.getTaxonomySession(clientContext);
var termStores = session.get_termStores();
var termStore = termStores.getByName('TermStoreName');
var termGroup = termStore.get_groups().getByName('TermGroupName');
var termSet = termGroup.get_termSets().getByName(termId);
// Get all the terms
var termColl = termSet.get_terms();
clientContext.load(termColl);
clientContext.executeQueryAsync(function () {doStuff();});
It work well for most users but when this page is visited by a user with Read permission the code above doesn't work.
In particular there is an error during the retrieving of the TaxonomySession object using the clientContext. this error don't allow me to execute the intialization of the all required objects to retrieve the list of terms from the termset.
Is it allowed to access the TaxonomySession with a Read profile? Should I use the SP.Service instead to retrieve the managed metadata?
Thanks
Leo