Questions tagged [role-assignment]

The role assignment is the relationship among the role definition, the users and groups, and the scope (for example, one user may be a reader on list one, while another user is a reader on list two).

Filter by
Sorted by
Tagged with
3
votes
2answers
113 views

Remove All RoleAssignemnts Except Current Loggedin User

I have written code for removing all roleassignments for a splistitem using the itemadded() and itemupdated() eventhandler . But my requirement is how can I prevent the removal of currentloggedin user ...
3
votes
1answer
102 views

REST API equivalent of SPRoleAssignmentCollection.AddToCurrentScopeOnly

To add a custom permission to a List or an item, we can use SPRoleAssignmentCollection and we can also use AddToCurrentScopeOnly to avoid adding users with Limited Access permission to the parent. In ...
2
votes
1answer
52 views

How to convert user field values into objects for adding permissions in powershell?

I have a list with a multi select (user and group) field. I want to grab the values from there and then pass them to the add permissions method. I grab the values but they come out like this 12;#...
1
vote
1answer
20 views

Site collection administrator created through CSOM cannot view site

I am having a strange situation where I am not able to view a site collection as a site collection administrator. The catch is that I created the site collection admin through CSOM. Steps to ...
1
vote
1answer
1k views

Remove Role Assignment by Role Definition name

I'm adding permissions for a user for a specific SPListItem: SPRoleAssignment roleAssignment = new SPRoleAssignment(user); roleAssignment.RoleDefinitionBindings.Add(web.RoleDefinitions["ASpecificRole"...
1
vote
0answers
110 views

Addroleassignment uses a subsite specific principal guid using Rest

I am trying to add role assignments to SharePoint Online to a folder on a personal sub site. I looked up all the users against the parent site and I have a guid of 282. When I try and assign a new ...
0
votes
1answer
348 views

CSOM + SharePoint Online - unable to get list item role assignments

I have made a very simple CSOM program where I have fetched a List Item and I have verified that it has listItem.HasUniqueRoleAssignments = true So with that being the case, I want to get the List ...
0
votes
1answer
490 views

JSOM Break SharePoint List Item Permission

I wrote the following code to break list item permission. Code works fine other than a small issue. var user; function breakItemPermission(itemID) { //Get the current context var context = ...
0
votes
1answer
383 views

Copy role assignments from one folder to another using CSOM C#

I want to copy role assignments from one folder and set it to other folder I am basically creating a subfolder and I want that folder to have same permission as its sibling I tried Folder ...
0
votes
1answer
3k views

breakRoleInheritance and addRoleAssignment not working using rest api query

I have a site accessible by everyone in our organization, inside this site, one library. In this everybody can create folder to upload the files, this is happening through provider hosted app using ...
0
votes
1answer
21 views

Unable to Remove a Users Permissions from a doc.lib item in a event receiver

As per my requirement i need to remove a particular user from his permissions from document library item .There is a field called Assigned_To in my docu.lib and I DONT want HIM to access the docu....
0
votes
0answers
8 views

I am Unable to Assign group and permissions to Specific file or folder using CSOM

everytime exception occures "Cannot add a role assignment with empty role definition binding collection " , I tried all the solution from other sources still facing same issue..please help.. my code ...
0
votes
0answers
12 views

ListItem.BreakRoleInheritance(true, false) Throws WebException: The remote server returned an error: (403) Forbidden. Retrying works sometime

public bool BreakListItemRoleInheritance(string siteUrl, Guid listId, int itemId, bool copyRoleAssignments) { try { var clientContext = Admin....
0
votes
0answers
14 views

Get User Access list by Folder Name instead of Folder ID in SharePoint

Is it possible to retrieve the list of users who have access to a folder in Sharepoint via folder name instead of folder ID? Reason: The folder is from a subsite, and have another unique id as ...
0
votes
0answers
8 views

SharePoint SecurityGroup role assignment - what value does it use? samAccountName, CN, or Name?

I have a sharepoint role assignment that points to a SecurityGroup on my active directory. DN = CN=Building Leasehold,CN=Users,DC=sp2016,DC=local name = Building Leasehold CN = Building Leasehold ...
0
votes
1answer
52 views

getting all AD groups and users of a site collection

Hello everybody I am quite new to the Sharepoint, I am trying to get all the AD groups who have permissions on a sitecollection. I am able to get all the SPgroups and users using the code below in my ...
0
votes
1answer
974 views

SharePoint 2013 REST API Filter hidden Fields

I have a little Problem. I'm trying to do the following. There is a Field on SharePoint List items called HasUniqueRoleAssignments that is hidden on a standard REST call. If I put it in the select ...