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

I have a document library with about 25,000 folders in it, each folder represents a task in our task system and is used as a document repository for those tasks.

Of the 25,000 tasks about 22,000 are in a closed state (completed, cancelled, etc...). Our goal is to make the folders for closed tasks read only and the remaining 3,000 ones not. We expect to write .NET code which will interact with the SharePoint API and/or workflows to accomplish this. Metadata exists on the folders which can be used to calculate whether or not the folder should be read only or not.

We already tried setting the default permissions for the document library to read only and then setting custom permissions for the remaining 3,000 items (through code) to open back up access... what a nightmare. we passed that 1,000 security scope limit and just about took out the whole farm...

share|improve this question
2  
What about an "archive" process that moves them into a separate document library? Then, that doc lib could have the read only permissions. –  Kit Menke Nov 13 '11 at 5:52
    
A 'read only' is a security aspect, You cannot do it without editing permissions.You can make the task easier by grouping the items\folders into two separate folders or document libraries. –  Amit Kumawat Nov 13 '11 at 6:02
    
@Kit - We've considered the idea of putting the closed items into separate folders/separate document libraries. The problem is that there is a vendor provided interface which connects our task management system with SharePoint and it expects all the folders to be in the root of a single document library. Because of this people would no longer be able to launch the folders from the task system if the task was closed. –  Peter Nov 13 '11 at 17:08
add comment

2 Answers 2

up vote 2 down vote accepted

You can create event receiver that will check that task is closed and disallow adding file and redirecting to custom page, where the details will be shown. Please check the article related how to implement in in SP2007 - http://www.sharepointkings.com/2008/06/redirection-from-event-handler.html.

But in my opinion archiving process will be better, as @Kit Menke suggested.

share|improve this answer
    
This sounds like it could work. Per @Sig Weber I'll also need to disable viewing in windows explorer and DataSheet view, but putting in a custom event receiver sounds plausible. –  Peter Nov 13 '11 at 17:12
add comment

Hmmm, I'm leaning towards a custom EventReceiver which fires on ItemAdding, ItemUpdating and ItemDeleting and checking the folder metadata if it is marked as "closed".

If so, any operation is denied and a custom error message is returned.

This would also require to disable DataSheet view and opening in Windows Explorer as those do not allow to display custom error messages.

share|improve this answer
add comment

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.