2

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,

4 Answers 4

4

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.

2
1

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.

1

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.

-1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.