Tag Info

New answers tagged

0

Using csom PowerShell you can try below function to give a group your desired permissions it uses Microsoft.SharePoint.Client.RoleDefinitionBindingCollection and Microsoft.SharePoint.Client.RoleType to get role types. function Set-PermissionsOnList() { param( [Parameter(Mandatory=$true)][string]$url, ...


1

You should use microsoft.SharePoint.Client.RoleDefinitionBindingCollection instead of Microsoft.SharePoint.Client.RoleAssignment. Try below snippet (Not tested but will give you idea of what all steps are required): # Get the list by Title and load. $web = $ctx.Web $list = $web.Lists.GetByTitle("Quiz") $ctx.Load($list) # Load in list of groups on the ...


0

It appears what you are doing is correct. You can view the official documentation on How to: Break Role Assignment Inheritance Using JavaScript. The subsection on Breaking the Security Inheritance of a Document and Changing the Permissions of a User is the most pertinent.


0

Magali, This very same problem happened to us not too long ago...and I was pulling my hair out for days. It may not apply in your case, but some of our user AD accounts were recreated for some reason. Even though their user name stayed the same, the SID is different when you recreate and account. We had to do exactly what you mentioned. We had to delete the ...


0

Also note, that when Set-SPUser fails it is a non-terminating error, so you will not hit your catch block. See http://stackoverflow.com/questions/1142211/try-catch-does-not-seem-to-have-an-effect Reproduced here: If you want try/catch to work for all errors (not just the terminating errors) you can manually make all errors terminating by setting the ...


1

If you want to do things based on the current user's permissions here's your solution: var ctx = new SP.ClientContext.get_current(); var web = ctx.get_web(); ctx.load(web, 'EffectiveBasePermissions'); ctx.executeQueryAsync( function () { var permissions = web.get_effectiveBasePermissions(); ...


0

This works for me without the error $ensuredUser = $web.EnsureUser($user.trim()) $group = $web.SiteGroups[$groupname.trim()] $group.AddUser($ensuredUser)


0

Please stop creating several questions for the same topic. To help anyone finding this topic, I'll post my answer here aswell. The reason your code is not working is that TaxonomySession uses the user from the HttpContext. I found this link which is in German but the suggested code looks like this: HttpContext oldContext = null; try { //Save actual ...



Top 50 recent answers are included