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 it possible, when you upload a document and put it in a library, to set automatically inherited rights from the library to this document ? Because, for the moment, when I upload a document (during page edit) it set only the administrator and the uploader in the authorizations. How can I resolve this problem ? Thank you with advance and sorry for my poor english.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

you need to create an event receiver in the item adding event, then in that event you can set permissions your self with the SPFolder and SPFile classes.

Here is an example of more or less how can it be done http://blogs.msdn.com/b/robgruen/archive/2007/11/15/how-to-programmatically-set-permissions-on-files-folders-in-a-sharepoint-document-library.aspx

how to create an event receiver http://msdn.microsoft.com/en-us/library/ee231563.aspx

share|improve this answer
    
Thank you very much ! But do you know if there is an easier way to set only inheritance rights ? It's sounds very strange to me that inheritance rights aren't set by default... Thank you again even so ! –  cocoggu Feb 17 '12 at 13:55
    
actually by default inheritance rights are always Inherited, lol, thats the default behavior, your file will inherit the permissions of your document library, the doc library will inherit the permissions from your site, etc, etc. However you can break the inheritance manually at any time.. –  L.V. Sharepoint Architect Feb 17 '12 at 13:57
    
Yes it is what I don't understand, when I upload a new file during page edit, only two users are set in rights : Portal admin and the uploader (or the creator of the document I don't know) and library have a long list of users inherited from my site... I'm a bit lost :) –  cocoggu Feb 17 '12 at 14:04
    
Sorry for my poor english and ambiguities I'm french –  cocoggu Feb 17 '12 at 14:05
    
Could it come from the template of the type of document ? –  cocoggu Feb 17 '12 at 14:19

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.