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 need to create permissions for folders based on dates.

For example:

Group B and Group A both have permissions for folder X. On june 21st of every year, group B will lose access to Folder X until August 1st.

Is this possible? And how would I go about setting these permissions?

Thanks,

share|improve this question
add comment

4 Answers 4

up vote 4 down vote accepted

AFAIK, there is no standard way to achieve this.

But this can be done programmatically with no apparent troubles.

In this case, I would recommend you to create a timer job, and based on settings stored in detached "configuration" list - change permissions on particular folders every night (or more often, if needed).

I assume, the "configuration" list should include: a Folder lookup column, a Start date and an End date date columns, and finally, Denied Groups column of type 'Person or group'.

In the timer job, you should instantiate the particular SPWeb object, connect to the configuration list, and retrieve all items where Start date or End date equal to the current date. I'd recommend you to use CAML query and SPList.GetItems method to retrieve the rules.

Then, for each rule, you should retrieve the corresponding folder element from the primary list, and change it's permissions respectively to the rule contents.

I would estimate, it would take about 1-2 days, to implement all this functionality from scratch, depending of your experience with timer jobs and permissions.

share|improve this answer
    
Thank you for the advice. Would you happen to have sample code for a timer job? –  novicePrgrmr Oct 25 '11 at 18:09
    
Unfortunately, I don't have sample code. But every part of the proposed solution could be easily googled. For example, you can read about timer jobs in following MSDN article: msdn.microsoft.com/en-us/library/cc406686(office.12).aspx –  Andrey Markeev Oct 25 '11 at 18:29
    
Ok thanks a lot! –  novicePrgrmr Oct 25 '11 at 18:42
add comment

Since this is a long running task that should not require user interaction you would have to create a workflow and bind it to the list / library in question. 2010 has a Replace permissions action which you could use to swap out the "allow both" to "allow only b" and have it run at the specific time interval you mentioned.

share|improve this answer
add comment

There is another possibility of doing this out of the box in SharePoint. By enabling information management policy to the respective document library, you can set content type policies to the particular folder that you have created. These folders can then be given a retention period, upon which you can decide whether the folder needs to be moved to recycle bin, or another library, etc. There are plenty of options that you could explore.

share|improve this answer
add comment

You can create a custom timer job and work it out.

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.