I want to break security inheritance for document library item in order to read file of their own and to provide access to only their manager.
I chose event handler option to break the inheritance and assign permission to document owner as reader and his manager as contributor (I can get all properties from user profile properties) If I hardcode value for employee Name and Manager name, it works perfectly. If I use the metadata value for logged in user and manager metadata of the file that is being upload, it does not fire or get those values. As part of the file upload process, document metadata contains owner, manager information.
Is this not possible to retrieve the document metadata properties when the file gets uploaded? If no, what could be the work around.
If I debug the code, it works great and catches the metadata properties as well. However when I deploy, it does not fire the event to break the inheritance and assign permission to individuals
Appreciate if you have any suggestions