1

Is there a event which is raised when permission of a sharepoint list item is changed. For instance permission is granted or revoked on a list item

2 Answers 2

2

Actually, there is no build in permission-relaited events for list/web/site/users/groups/etc.

As a "might be solution" you can use SPChangeQuery class and queries against necessarily objects. For example, this trick might be used with custom timer job + SPChangeQuery queries to handle user permissions/groups or group changes as you have quite interesting stuff like GroupMembershipAdd/GroupMembershipDelete or RoleDefinitionAdd/RoleDefinitionDelete and so on in result sets.

0

I think that you can use SPItemEventReceiver.ItemUpdating and SPItemEventReceiver.ItemUpdated events. If you look how to cahnge item permissions you can see that item.Update() method is invoked.

SPRoleAssignment roleAssignment = new SPRoleAssignment(principal);
SPRoleDefinition roleDefinition = web.RoleDefinitions.GetByType(roleType);
roleAssignment.RoleDefinitionBindings.Add(roleDefinition);

item.RoleAssignments.Add(roleAssignment);
item.Update();

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.