Tag Info

New answers tagged

0

Try the below code. You should first get the Role Assignment if the group from the role assignment collection of the web.Then use importRoleDefinitionBindings method of the roleassignment object to add the Read role definition binding. This will remove the existing bindings and add the new binding. var clientContext; var currentWeb; var ...


1

If you have different permission levels for each of those group, you can wrap your content in an SPSecurityTrimmedControl. This will show/hide content for users based on their level of access. Unfortunately this will not work based on group name, only the resulting permissions that users have from being in a group, so if both groups have the same ...


0

You can create the menu using JavaScript. Then you can use Client Object Model to check the group of the user. If you need help to check the group with JavaScript, try this link: http://stackoverflow.com/questions/22122139/check-if-current-users-belongs-to-sp-group-using-javascript-client-side-object-m


1

This can be done with the SPSecurityTrimmedControl if there is a permission difference in the 2 groups. <ul> <SharePoint:SPSecurityTrimmedControl PermissionsString="OpenItems" runat="server"> <li>Option 1</li> </SharePoint:SPSecurityTrimmedControl> <SharePoint:SPSecurityTrimmedControl PermissionsString="ManageLists" ...


0

If you want to check if the current user logged in is a member of some group, you can use the code below: public static bool CheckAdminUser() { var isMember = false; try { using (var oSite = new SPSite(PortalUrl)) { using (SPWeb oWeb = oSite.OpenWeb()) { ...


1

You can use REST api for this: function getData(siteurl) { var endpoint = siteurl+"/_api/web/currentuser/groups"; $.ajax({ url: endpoint, method: "GET", headers: { "X-RequestDigest": $("#__REQUESTDIGEST").val(), "Accept": "application/json; odata=verbose", "Content-Type": "application/json; odata=verbose" }, ...


0

You can use Target Audience property of webpart. This is out of box and available in webpart properties in "Advance". In Target Audience, you can add a SharePoint group and webpart will be visible for that group only. For reference:Target content to specific audience Still if you want know whether user belongs to specific group. You can use below code: ...


1

When a user is added to Office 365, the user automatically becomes a member of Everyone except external users. By default, the Everyone except external users group is added to the Members group on the SharePoint Team Site. It is automatically assigned a permission level of Contribute. This means all users who are added to Office 365 can view, add, update, ...


2

This is not supported by SharePoint Online, here is the excerpt from the reply of a Microsoft support: "it is not feasible to remove SharePoint Online internal users from this group. This group is created by SharePoint Online system by default to contain SharePoint Online internal users. It is used for the scenario when sharing some SharePoint Online ...


1

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, ...


2

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 ...



Top 50 recent answers are included