Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

share|improve this question

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

share|improve this answer

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();
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.