I want to execute some code when the users/groups with access to a web changes (addition and removal of users/groups). What are my options?
1 Answer
If you are using SP 2013, you can SPSecurityEventReceiver
. A good resource on this is: http://www.timferro.com/wordpress/archives/737.
Excerpts:
[This Server Side and Remote Event Receiver] Provides methods [in 5 main categories: 1. Group Events, 2. User Events, 3. Inheritance Events, 4. Role Assignment Events, and 5. Role Definition Events] to trap events [Adding/Added/Updating/Updated/Deleting/Deleted/Breaking/Broken/Reset/Resetting] that are raised [at the Site Collection or Site level] for security.