.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

set or remove permissions of the folder

Posted By:      Posted Date: September 19, 2010    Points: 0   Category :.NET Framework

hi forum

Is it possible to set or remove permissions(read, write,delete)  of any Existing folder using c#. if yes then how we can do ???


thanking you in advance

View Complete Post

More Related Resource Links

Access denied to folder in ASP.NET project either though I have granted all users full permissions !



i have made a very simple file upload app, that i want users to be able to upload images to a folder on my server, well localhost for the time being Stick out tongue

here is the simple upload code...

        protected void ButtonRegisterDetails_Click(object sender, EventArgs e) 
            // display properties of the uploaded file 

Permissions issue for custom web service in the _vti_bin folder.

Hello, I have created a custom ASMX webservice that returns in JSON format so that I can call the data from JQuery on SharePoint page content.  I placed it in the ISAPI (_vti_bin) folder and it works just fine when I go directly to the web service and call it the way JQuery calls it: /_vti_bin/ServiceabilityCheck.asmx/GetSystemIDByZIPCode?ipaddress= Which returns: <string>{"SystemID":"5"}</string> When I try to call it from the SharePoint site with JQuery, it errors out and gives an unspecified error.  Fiddler shows {"Message":"Authentication failed.","StackTrace":null,"ExceptionType":"System.InvalidOperationException"} as the response from the web service call. When I have the webservice on an IIS web app outside of SharePoint, it works fine.  I have anonymous access enabled on the SharePoint site, why would it give me this error?John Chapman | Blog: http://www.johnchapman.name

Copy sharepoint 2007 folder (with sub folders) with all the security permissions

I am looking to copy a common sharepoint folder(sub folders) in 2007 with all the security permissions intact, to a different location in the same site, Does anyone know how to do this?

Minimum Permissions Needed To See Cdc tables In System Tables Folder

What are the minimum permissions needed for a user to see the cdc tables in the System Tables folder in SQL Management Studio?DJ Baby Anne's Biggest Fan................

Copy sharepoint 2007 folder (with sub folders) with all the security permissions

I am looking to copy a common sharepoint folder(sub folders) in 2007 with all the security permissions intact, to a different location in the same site, Does anyone know how to do this?

New to Sharepoint companyweb and deleted all folder permissions by mistake

Hello.  I am just delving into the world of Sharepoint and testing to see if it will help our company meet it's needs for accessing files remotely as well as giving us collaberation abilities we currently don't have.  We recently purchased a new Windows 2008 Small Business Server which includes Sharepoint 3.0 and I've been messing around with the companyweb page.  My current goal is to emulate how we are using network drives.  There is a drive for each department and then a shared drive where common files for eveyrone are stored.  Rights are maintained using security groups. In the companyweb, inside the Document's section I created a new library named "Department Files" then within that created folders for Accounting, Customer Service, HR etc.  Being completely new to Sharepoint I was editing the permissions to the Accounting folder but forgot to add the domain administrator before deleting the existing rights.  Now the folder is no longer visible and I can't figure out how to edit the rights to it. The permissions that were removed were: CompanyWeb Members, CompanyWeb Owners, and CompanyWeb Visitors. Where can I go to see this hidden directory and change/restore the permissions?  Since this is all testing stuff I can also delete it and start again.  There isn't any info that I need to worry about retaining at thi

Alternative solution to folder level permissions

I have a document library with multiple levels of folders that group sets of documents. Each folder has unique permissions setup. Ran into issue with URL length limitation because of multiple levels. I am looking at an alternative solution using meta data columns and views to categorize data. Everything is fine except I am not sure how to implement security akin to permissions on folder. How would I implement security based on meta data columns ? One soution that I can think of is creating workflows using SPD. Are there any other solutions for this ?

Create report that lists every user with permissions for each folder

I would like to have a report that will list each user with it's roles for every folder. We have a very large RS database with a lot of folders, we need some better way to keep track of permissions. I created a report that utilizes "GetPolicies" from http://localhost/reportserver/ReportService2005.asmx but I have to feed a folder name to get list of users. I can also (by using subreport) list all folders with users. However, I am not able to produce a report where I have it broken by user. any idea?

Folder and document specific permissions

My problem is that when I grant a user Read/Contribute permission to a document which is located in a folder in a library where I have not granted access to the user before. When the user is granted a Read/Contribute permission to the document the system creates a restricted permission to the library and to the folder where the document exists. But the problem is that the user can't access the file throught browser or Sharepoint Workspace. User can view the library but do not see the folder where the document is and in SharePoint Workspace the file is visible when syncing but the path to the file is wrong. Allthough user can find and access the file using a fileID.

Folder permissions in Sharepoint library corrupt


The permissions of a Folder in my Sharepoint 2010 library have become corrupt

The permissions cannot be edited

When "manage permissions" is selected for the folder the following error occurs


Cannot complete this action.

Please try again.


Troubleshoot issues with Microsoft SharePoint Foundation.

Correlation ID: 761c6efa-d7f9-4d34-ac2b-e0bbb609f82c

Date and Time: 10/8/2010 12:20:14 AM

The folder cannot be deleted

When a attempt is made to delete the folder the following error occurs

Even when using the site administrator account


Error: Access Denied

Current User

Web services do not respect folder permissions?


I seem to have found a problem with web services where folder level permissions are not respected when adding a list item.  This problem does not occur when using SharePoint through the browser.  My scenario is as follows. 

I have a list with two folders.  I want to give all users in Group 1 and Group 2 read access to all items in the list, but I want only users in Group 1 to have write access (Contribute) to Folder 1 and only users in Group 2 to have write access to Folder 2.  I have granted permissions as follows:

List (Group 1 - Read, Group 2 - Read)

  • Folder 1 (Broken Inheritance: Group 1 - Contribute, Group 2 - Read)
  • Folder 2 (Broken Inheritance: Group 1 - Read, Group 2 - Contribute)

With this setup, when using web services, NONE of the users are able to write to either folder.  Alternatively:

List (Group 1 - Contribute, Group 2 - Contribute)

  • Folder 1 (Broken Inheritance: Group 1 - Contribute, Group 2 - Read)
  • Folder 2 (Broken Inheritance: Group 1 - Read, Group 2 - Contribute)

With this setup, ALL of the users are able to add and item to either folder.  Interestingly, the groups set to Read at the folder level cannot update the items that they created, so that part is working, but the Add permission is not respected.

Overall, the web servi

retrieve NTFS file / folder permissions


Using .NET 4.0, is there a good way to retrieve the NTFS permissions for a given file or folder?   Specifically, I would like to know if the current Windows user has write / delete permissions for a given folder.   I don't want to modify the permissions, just want to look at them to know if its safe to continue running.





windows authentication and folder ntfs permissions


hi all,

i created a website that uses windows authentication. i have a page that should display a list of folder that the logged in user has permission to read. how i can check if the user has a read permission on specific folder or not and how to display the groups that the user is belong to.

Can't manage folder permissions.



When a user clicks on the drop down menu for a folder in a document library nothing happens. At the bottom of their browser "Error on page" is displayed and the following error is logged:

Message: 'length' is null or not an object
Line: 451
Char: 13
Code: 0

After further investigation I found this problem throughout our Sharepoint 2007 WSS 3.0 instance but only on the sites that were rolled from Sharepoint 2003. Any of the sites created after we migrated do not present this problem. 80% of our site was created previous to the migration so recreating each site is not an option. Creating a new folder, has the same issue. However, you can manage properties on documents in the same library and in the affected folder just fine. Our Sharepoint instance was migrated 2 years ago and this problem just cropped up.


Has anyone run into this problem, have a fix or have any ideas on troubleshooting it?

Why disappear permissions of document folder?



I have problem with permissions of document folder. Laws disappear from time to time and I don´t know why it happen.

It is happening by folder, wich is divided to several subfolder. For example: folder1/folder2/folder3


folder1 is document library, where is set up, that users from group "reading" have permission for reading this folder.

folder2 inherit laws from folder1

folder3 - permissions for this folder are withdrawal from group "reading" and to this folder is added user with permission for reading and contribution.


Problem is that from time to time folder1 loses permissin for group "reading" and at the same time folder3 loses permission for user, who can contribute in folder3.

Users for the folder3 we add, this is not inherit from folder2. I cannot find why disappear permissions for users, who we add.

We use Sharepoint Services 3.0

Thank you for your help!

Folder Permissions in Windows7 using C# code and window forms


I want to give full control or write permissions to the folder in program files folder in windows 7 OS using c# code for any user.

Ex: C:/Program files/ABC/XYZ

I want to give full control permissions to XYZ folder for all users in that system when my application is accessed.

Pls help me Its an urgent requirement in my project.

Thanks in Advance

Remove #Region from whole web site


Hi All,

I need to deliver source code to client and my boss need to remove all the comments and #region sections from the whole web site source code.

So is there any functionality available in visual studio 2010 or may be in an other 3rd party tool available to do so, which can remove all the #region from all over the source code ?

Otherwise my developers has to do donkey work.... :(( and I don't wish it. 

Any help or tips/tricks would be appreciated.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend